We are trying to add a cookie policy to an old website, made a long time ago. The cookie policy (javascript) works fine in chrome, ff etc, but IE kicks into quirks.
I inspected the generated html and.. oh my.
It looks something like:
html
head
/head
html
body
head
/head
/html
/body
html
You get the picture, its ugly. When it was built they included separate .shtml files, all which come inclusive with their own html, head etc.
There is nothing above the doctype so I have erased that as the problem. The doctype is:
<!doctype HTML PUBLIC "-//w3c//DTD HTML 4.01 Transitional//EN">
jsfiddle with html from the index page, not there for presentation, its there if you want to look at the demons that be (code).
So, the question I am asking, is what could be causing quirks mode to kick in? Is there a ‘hack’ to prevent it?
When I display it explicitly as ie7+ its fine, so as a cheat can we just set it to not go to quirks?
Thanks.
Generally, quirks mode is turned on when there is no correct DOCTYPE declaration, and turned off when there is a DOCTYPE definition. However, invalid HTML – with respect to the chosen DOCTYPE – can also cause the browser to switch to quirks mode.