Reputation: 39028
Not sure why my text in the 2nd list isn't getting centered.
The 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;
}
}
}
Any thoughts on what could be forcing Stephen Marston to not center?
Upvotes: 5
Views: 322
Reputation: 191749
There is an element being floated in #mobile-action-area
that is interfering. You need to clear this float. There are a variety of ways to do it. Adding overflow: hidden
to #mobile-action-area
fixes it. You may also try:
#mobile-action-area:after {
display: table;
content: "";
clear: both;
}
Upvotes: 5
Reputation: 3856
You'll need to clear the float before #the_target
#the_target {
position: relative;
margin-top: 40px;
clear:both;
}
Upvotes: 2