页脚中的图像和文本对齐

时间:2015-06-25 13:40:33

标签: html css responsive-design

我正在学习css和html,同时定制一个wordpress主题, 但是我无法将图像和文字扩展到移动设备。

事情是我有两个部分有白色背景,第一个有3个带链接的图片,第二个是带有站点地图的典型页脚等。

我希望将照片放在中心位置,然后让它们在移动设备上以及页脚缩放。

目前最后一张照片已被删除

http://codepen.io/phoez/pen/RPjdrr

#partnerzy {
  background-color: #ffffff;
  height: 80px;
  width: auto;
}
#rgw {
  padding-left: 10%;
  padding: 10px;
  float: left;
}
@media (max-width: 800px) {
  #rgw {
    padding-left: 10%;
    padding: 10px;
    float: left;
    max-width: 40%;
  }
}
#zgs {
  padding-left: 15%;
  float: left;
  text-align: center;
  width: auto;
}
@media (max-width: 800px) {
  #zgs {
    /* padding-left: 25%; */
    float: left;
    text-align: center;
    width: auto;
    max-width: 40%;
  }
}
#sa {
  padding-left: 25%;
  float: left;
  width: auto;
}
@media (max-width: 800px) {
  #sa {
    padding-left: 55%;
    width: auto;
    max-width: 33%;
  }
}
#stopka ul {
  list-style: none !important;
  background-color: #ffffff !important;
  text-align: center !important;
  padding: 0 !important;
  margin: 0 !important;
}
#stopka a {
  text-decoration: none !important;
  display: block !important;
}
#stopka li {
  margin-left: 30px;
  font-family: "Roboto", sans-serif !important;
  font-size: 13px;
  font-weight: 700 !important;
  text-decoration: none;
  color: #999999;
  line-height: 40px;
  height: 40px;
  display: inline-block;
  margin-right: 5px;
}
#stopka {
  background-color: #ffffff;
  height: 80px;
  width: auto;
}
<div id="partnerzy">
  <div id="rgw">
    <a href="">
      <img alt="RGW" src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
    </a>
  </div>
  <div id="zgs">
    <a href="">
      <img alt="ZGS " src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
    </a>
  </div>
  <div id="sa">
    <a href="">
      <img alt="Schleifenbaum & Adler" src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
    </a>
  </div>
</div>
<br>
<br>
<div id="stopka">
  <li class="mapa"><a href="">Sitemap</a>
  </li>
  <li class="redakcja"><a href="">Editorial office</a>
  </li>
  <li class="nota"><a href="">Legal note</a>
  </li>
  <li class="politykacookies"><a href="">Cookies policy</a>
  </li>
  <li class="regulamin"><a href="">Portal rules</a>
  </li>
</div>

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

#partnerzy {
  background-color: #ffffff;
  width: auto;
text-align: center;
}
#partnerzy > div{
  padding: 10px;
display: inline-block;
text-align: center;

}

#stopka ul {
  list-style: none !important;
  background-color: #ffffff !important;
  text-align: center !important;
  padding: 0 !important;
  margin: 0 !important;
}
#stopka a {
  text-decoration: none !important;
  display: block !important;
}
#stopka li {

  margin-left: 30px;
  font-family: "Roboto", sans-serif !important;
  font-size: 13px;
  font-weight: 700 !important;
  text-decoration: none;
  color: #999999;
  line-height: 40px;
  height: 40px;
  display: inline-block;
  margin: 0 15px;
}
#stopka {
  background-color: #ffffff;
  height: 80px;
  width: auto;
clear: both;
text-align: center;
}
@media (max-width: 520px){
#partnerzy > div{
    display: block;
    clear: both;
}
#partnerzy > div img{
    width: 60%;
}
}
<div id="partnerzy">
  <div id="rgw">
<a href="">
  <img alt="RGW" src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
</a>
  </div>
  <div id="zgs">
<a href="">
  <img alt="ZGS " src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
</a>
  </div>
  <div id="sa">
<a href="">
  <img alt="Schleifenbaum & Adler" src="http://38.media.tumblr.com/avatar_c9671e5c8ca3_128.png">
</a>
  </div>
</div>

<div id="stopka">
  <li class="mapa"><a href="">Sitemap</a>
  </li>
  <li class="redakcja"><a href="">Editorial office</a>
  </li>
  <li class="nota"><a href="">Legal note</a>
  </li>
  <li class="politykacookies"><a href="">Cookies policy</a>
  </li>
  <li class="regulamin"><a href="">Portal rules</a>
  </li>
</div>