Margin: 0 auto; Not Centering The Web Page :-(

Buongiorno from -1 degrees C wetherby UK :slight_smile:

On this page http://tutorial.davidclick.com/2menu.html ive applied some css rules to centre the page in the middle of the viewport better explained here: http://www.maxdesign.com.au/articles/center/

Heres the css:

#container
{
width:960px;
border-color:black;
border-width:5px;
border-style:solid;
margin:0 auto;
}

But it works in Firefox but not ie 9 :frowning: Please could a sitepoint member give me a steer to fixing this its really bugging me.

Grazie tanto,
David

HI David its me David replying to yourself :slight_smile:

I figured it out… The doc type declaration had a typo. When a doctype has typo IE switches to quirks mode and ignores the centering CSS. To fix make sure the doc type declarion reads this <!DOCTYPE html> and not <!DOCTYPE HTML>

Good luck!

Thanks inner voice of wisdom you fixed it :slight_smile:

Closed just to preserve the humor. :wink: