Currently the page I am working displays fine in Chrome and Firefox, but in IE9 it is rendering in Quirks mode.
Looking into the issue further, it seems that
<Also check your IE,
I don't know what you mean by "[the doctype] is always getting commented out".
There are many different things that can cause Quirks Mode, see here.
Another common cause is having stuff before the doctype. Even invisible stuff.
You can fix this without debugging the actual problem if you add this in your <head>
:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />