I have absolutely no idea why this isn't working. I'm trying to align the navigation and content of a website, navigation is fine at the moment.
Problem: Whatever I change in the CSS for content does not affect the class in the other page.
<div class='content'>
aslkdhal;kshl;kasdkjasdhkjlashkjashdkjalsdklajsd
</div>
div.content{
margin-left: auto;
margin-right: auto;
}
I'm sure it'开发者_StackOverflow社区s simple. Thank you in advance.
You're right, it is simple. You just need to specify .content's width.
margin-left: auto;
margin-right: auto;
centers the div itself, not the content.
精彩评论