I first realized that I hadn't included a doctype declaration. The HTML5 doctype is simply
<!DOCTYPE html>
However, even with the doctype, the page was still staying in quirks mode. Pages like the fish test were working fine. When I noticed that my examples were working fine from sourceforge, my google searches changed from "always in quirks mode" to "quirks mode localhost" and I quickly found a KB article about compatibility view.
After feeling like an idiot for a few seconds about not finding the "compatibility view settings" item in the sprocket menu, I stopped looking at the images and started reading the actual text and understood that the Tools menu is not the sprocket menu. Pressing alt brings it up. I blame the lack of coffee at that time.
In the compatibility view settings, there is a checkbox "Display intranet sites in compatibility view" that is checked by default. Unchecking it fixes problem.
Therefore, make sure:
- the html page starts with
<!DOCTYPE html>
but without anything before it, including a BOM mark; - the compatility view settings (in the Tools menu) for local files is unchecked;
- you're not forcing any specific document mode in the developers tools;
- you're not using any kind of X-UA-Compatible meta tags;
- the windows group policy isn't forcing compatibility mode.
No comments:
Post a Comment