How often have you wanted to make your website appear in the middle of the users browser?

Centering a website is quite simple, in your html create a div called wrapper and add some text e.g.

some text

Now in your css add this,

#wrapper {
width:960px;
margin:0 auto;
text-align:center;
}

The width can be any amount as long as it’s less than 1200px (the most commonly used screen size of users). I have added the IE 6 fix. IE6 doesn’t like the margin: auto command so we need to add the text-align:center; command to combat this.

Post to Twitter