Reputation: 12163
I'm making a wordpress theme, and in IE, on my homepage of the theme, everything is aligned left, but everything that should be centered is centered when viewing a page or post.
I have tried cutting out almost everything from the homepage and I still have not found the origin of this.
The weird thing is though, that using IE Developer Toolbar, setting the Document Mode to IE 8, makes it work like a charm. But by default, the Document Mode is Quirksmode (which makes no sense, since I use DOCTYPE html!
I tried using the X-UA Compatible metatag, but that did not do it either.
I'm afraid that I cannot provide enough code as it would simply be too much.
How can I force IE to not use Quirksmode? As I said, I tried everything I know, and everything I could find on google, and nothing helped.
Here are a few screenies that may help you understand my problem.
Thank you in advance!
Upvotes: 0
Views: 5620
Reputation: 12163
I figured out what the problem was - Jukka was correct about the local environment being quirked, but to solve it, I found that I had to place the X-UA-Compatible metatag as the first thing in the Head tag for it to work. I am however accepting Jukka's answer as it is the most informative one. :)
Upvotes: 2
Reputation: 3309
If you can, change your doctype to
<!doctype html>
Instead of
<doctype html>
The first is the HTML5 doctype, the second doesn't exist.
Upvotes: 1
Reputation: 201528
If you are testing the page locally only, the odds are that IE uses Quirks Mode just because of that. Try uploading the page on a server, test again, and post the URL if problems remain. (It could be some typo in the doctype declaration.) See also the page http://hsivonen.iki.fi/doctype/ which describes, among other things, some of the fairly confusing features of IE in the Quirks Mode issue.
Upvotes: 4