Center a Div Tag in CSS

Centering something with CSS isn’t very easy. Here is the simple code to center a div in the middle of a page.

text-align: left;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;

Just add that to a CSS Div and it will center it.

Related Posts Plugin for WordPress, Blogger...

Written by Andy Feliciotti

Andy Feliciotti is a UI Designer in College Park, Maryland. He diggs web design and social media, if it's on the internet he has probably seen it. You can stay up to date with what Andy does on twitter.