To check you are in quirks mode
In Firefox and Opera you can determine if your browser is in "quirks mode" by checking page info.
Using document.compatMode
, will tell you the mode you are in with most browsers.
In Chrome, Safari, and IE, run this javascript in the address bar:
javascript:window.alert('You are in ' + (document.compatMode==='CSS1Compat'?'Standards':'Quirks') + ' mode.')
(note that you'll need to re-type the javascript: portion after pasting into your address bar, due to recent security changes)
If you are in Quirk mode the issue is identified. It will be ok when you host the project.
Solution:
In other words, all browsers needed two modes: quirks mode for the old rules, strict mode for the standard. IE Mac was the first browser to implement the two modes, and IE Windows 6, Mozilla, Safari, and Opera followed suit. IE 5 Windows, as well as older browsers like Netscape 4, are permanently locked in quirks mode.
Choosing which mode to use requires a trigger, and this trigger was found in ’doctype switching’. According to the standards, any (X)HTML document should have a doctype which tells the world at large which flavour of (X)HTML the document is using.
- Old pages written before (or in spite of) the standardization wave
don’t have a doctype. Therefore ’no doctype’ would mean quirks mode:
show according to old rules.
- Contrarily, if the web developer was savvy enough to include a
doctype, he probably knew what he was doing. Therefore most doctypes
trigger strict mode: show according to pure standards.
- Any new or unknown doctype triggers strict mode.
- The problem was that some pages written in quirks mode did have
doctypes. Therefore each browser has its own list with doctypes that
trigger quirks mode. See this browser comparison chart for an
overview of these lists.