Reputation: 229
Why is the main content division in not centered in IE (although it is centered in Firefox and Chrome). The website URL is: website.
I took a look at this question on SO, but I couldn't resolve the issue.
Please help. Thanks.
Upvotes: 1
Views: 135
Reputation: 32192
Used to this Css
body{
text-align:center;
}
#main{
text-align:left;
}
Upvotes: 1
Reputation: 26898
This is happening because your page is going into quirks mode. Although @Rohit's answer solves (hides) the issue, you should use the following as your DOCTYPE
declaration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
And if the above isn't enough, add the following meta
tag as well (inside your head
):
<meta http-equiv="X-UA-Compatible" content="IE=8" />
This will prevent IE from going into quirks mode.
Upvotes: 0