Pages

Monday, October 15, 2007

How to horitontally center a div in CSS

This is so easy, I spit coffee through my nose.
<div style="margin-left:auto; margin-right:auto; width:150px; display:block;"> This div is centered </div>
And here's what it looks like:
This div is centered

No comments:

Share This!

Contact Us

Name

Email *

Message *