【发布时间】:2018-09-29 07:00:54
【问题描述】:
我在这里创建一个小提琴:http://jsfiddle.net/WayDf/27/
如何使 ul 中包含的四个白框在红色条中水平居中?我已经尝试了很多东西来添加#social ul 我只是无法弄清楚。我已经准备好阅读有关该主题的许多帖子,并尝试了许多以前建议的事情,但我无法解决我的特定问题。我错过了什么?
footer {
width: 100%;
position: relative;
background-color: #C5C5C5;
display: block;
overflow: hidden;
}
footer section#footer-content {
max-width: 1440px;
min-height: 50px;
margin: 30px auto;
padding: 0 .694444%;
/* 10px / 1440px */
position: relative;
display: block;
overflow: hidden;
}
footer #social {
height: 30px;
margin: 0 auto;
background-color: red;
width: 600px;
position: relative;
}
footer #social ul {
list-style: none;
width: 100%;
margin: 0 50%;
}
footer #social li {
float: left;
margin: 0 .3em;
position: relative;
display: block;
width: 30px;
height: 30px;
overflow: hidden;
}
footer #social a {
text-decoration: none;
color: #CC7D29;
background: #ffffff;
display: block;
text-align: center;
height: 30px;
}
<footer>
<section id="footer-content">
<div id="social">
<ul>
<li>
<a href="#"></a>
</li>
<li>
<a href="#"></a>
</li>
<li>
<a href="#"></a>
</li>
<li>
<a href="#"></a>
</li>
</ul>
</div>
</section>
</footer>
【问题讨论】:
-
this question 接受的答案可以提供帮助。
-
在发布之前我已经通读了这些内容,但我无法解决我的特定问题。当然我错过了一些东西,我只是不知道那是我发布的原因。谢谢。