verekia / initializr-template

Initializr's generated page
http://www.initializr.com
1.11k stars 365 forks source link

template breaks in IE when converted to dreamweaver template #10

Closed rtpHarry closed 12 years ago

rtpHarry commented 12 years ago

When I built a site based on this template and tested it in IE9 and IE8 they both triggered quirks mode and made the site look a mess.

I checked my X-UA-Compatible which was set to <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> but this didn't resolve it.

It turns out that the conditional comments on the <html> tag confuses the dreamweaver template system into putting its template mapping comments above the doctype which threw it into quirks mode.

It was a tricky one to debug as well because that tag isn't shown in the view source of the template.

Here is the offending code:

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

Here is the thread that made me realise what had happened: http://stackoverflow.com/questions/6294301/dreamweaver-causing-quirks-mode-in-internet-explorer

I don't know if this is something that could be hung off the body tag instead? If not this information should at least be added to the documentation wiki.

verekia commented 12 years ago

Hi @rtpHarry, Initializr is just a builder to customize HTML5 Boilerplate. The code that it provides comes (almost) exclusively from H5BP, therefore you should post your issue on H5BP's repo. If they solve it, Initializr will be updated with their fix too.

Thanks!