不确定为什么我在第二个列表中的文本没有居中。
HTML
<div id="the_target">
<ul>
<li>Stephen Marston</li>
<li>Account Exectutive</li>
<li>The Company</li>
</ul>
</div>
SASS:
section {
#the_requestor {
margin-top: 40px;
ul { margin-top: 10px; }
ul li {
text-align: center;
line-height: $px20;
}
li:first-child {
font-family: LatoBold;
font-size: $px30;
background: cyan;
}
}
#the_target {
position: relative;
margin-top: 40px;
ul { margin-top: 10px; }
ul li {
text-align: center;
line-height: $px20;
}
li:first-child{
font-family: LatoBold;
font-size: $px30;
background: cyan;
}
}
}
关于什么可能迫使斯蒂芬马斯顿不居中有任何想法吗?
最佳答案
#mobile-action-area
中有一个 float 元素正在干扰。你需要清除这个 float 。有多种方法可以做到这一点。将 overflow: hidden
添加到 #mobile-action-area
修复它。您也可以尝试:
#mobile-action-area:after {
display: table;
content: "";
clear: both;
}
关于html - 文本未在我的 li 中居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18519591/