Skip to content Skip to sidebar Skip to footer

Position:fixed And Margin:0 Auto Not Working In IE

I have coded a website in HTML and CSS. In this website I have used both properties margin: 0 auto and position:fixed on several occasions. The problem is that the website is corre

Solution 1:

There are non space characters before your doctype. The doctype should be the very first thing in the document. Because of this IE thinks the meta tags and others head elements are inside your body.

You can see this if you open the Developer tools (F12) in IE9.

The w3 validator would have told you too. Apparently it is a byte order mark (BOM), which should be omitted.

It's a good thing to learn to use these tools. They're essential for debugging problems like this.


Post a Comment for "Position:fixed And Margin:0 Auto Not Working In IE"