CSS Tutorials - How to center a box or image with CSS Margin

In XHTML 1.0 the ability to center a block-level element (e.g. image, div) was depracated. Aside of positioning the box absolutely with a top and left property value of 50% each, a better cross-browser method would be to utilize the margin:0 auto; alternative.

<style type="text/css">

div {
margin-left: auto;
margin-right: auto;
}

</style>