Reputation: 43
I have 3 sections, 1 is float left and the second is float right on same line. I want the third section block centered below the other 2. I can float it either left or right and add a bunch of margin to the opposite side and it works, but there must be a more efficient way. margin:auto for left and right sticks it to the right side. Any suggestions on why this will not center? Thanks
http://jsfiddle.net/tkennedy/69rj6d7f/
#interests {
width: 90%;
border: thin solid #000000;
margin-left: auto;
margin-right: auto;
clear: right;
}
Upvotes: 1
Views: 56
Reputation: 103388
You're inheriting float:right
from section
rule.
Override with float:none
.
#interests {
width: 90%;
border: thin solid #000000;
margin-left: auto;
margin-right: auto;
clear: right;
float:none;
}
Upvotes: 3