Wednesday, 4 January 2012

How to center a DIV in a DIV

HTML:

<div id="outer" style="width:100%">
    <div id="inner">Foo foo</div>
</div>


CSS:

#inner {
    width: 50%;
    margin: auto;
}