DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Center HTML Content Horizontally Using CSS
Ahh the infamous CSS centering thing... make sure to specify the width and set the right/left margins to 'auto'
#content {
margin: 0 auto;
width: 740px;
}
Your HTML would look something like this:
<div id="content">
This is centered
</div>




