Simple one that doesn’t seem to want to work..
I want to centre a div inside a 100% wide div.
HTML.
<div id="body-outside">
<div id="body-inside">
content
</div>
</div>
CSS.
#body-outside{
width:100%;
float:left;
background-color:#F7B3DA;
}
#body-inside{
width:1280px;
margin:0 auto;
background-color:#F7B3DA;
float:left;
}
The content is staying on the left of the screen at the moment.
Any ideas?
Thanks.
Get rid of
float:left;. This pushes it to the left despite setting the margin to auto.