Take the 2-minute tour ×

Why does IE9 lose all stylesheets when using a .cfm file name?

I'm testing a basic example template from Bootstrap (http://surgenia.com/instal/temp.cfm)

It works fine with FF and Chrome or even just changing temp file to temp.htm

share|improve this question
Are your css files included? Your page is still HTML when it's returned from the server. –  Matt Busche Feb 23 '13 at 18:42
They are included by link tags <link href="surgenia.com/instal/temp.css"; rel="stylesheet" type="text/css" /> Also just tried <cfinclude template="temp.css">, if thats what you meant? The page works fine in FF or chrome. –  scott7ree Feb 23 '13 at 23:29
You can try it at surgenia.com/instal/temp.cfm. or temp.htm (which works fine...even though they are the same file). –  scott7ree Feb 23 '13 at 23:39
i believe you need http:// with your css links –  Matt Busche Feb 24 '13 at 0:02
when I visit that link it works fine. –  Matt Busche Feb 24 '13 at 0:03

1 Answer 1

up vote 2 down vote accepted

This isn't to do with the extension - your temp.cfm and temp.htm files have different content.

Specifically, the temp.cfm file has a "store session variables" comment before the doctype, throwing IE into Quirks Mode. (Your temp.htm file does not have this comment, and is not in Quirks Mode.)

You can see this is what's happening by opening Developer Tools (press F12) - you will see in the HTML view that the doctype declaration is commented out, and the Document Mode in the top right of the window is "Quirks".

Change the mode to "Internet Explorer 9 standards" and the page displays the same as the temp.htm one. Removing the comment which is outputting will also have the same effect of not putting IE into quirks mode, (or change it to a CFML comment, as it's intended to be, but it looks unnecessary so removing it probably is best).

You might also want to consider placing <cfcontent reset type="text/html" /> immediately before any doctype declarations, to help avoid similar problems (by resetting the output buffer before output is started).

share|improve this answer

Your Answer


