HTML and CSS Reference
In-Depth Information
computer, when your page is being viewed on older versions of Internet Explorer. To
opt-in to using this plugin automatically, append ", chrome=1" to the content at-
tribute value for the http-equiv meta tag.
This tag can be set within the HTML file itself, which is what HTML5 Boilerplate does,
as shown in the following code snippet:
<meta http-equiv="X-UA-Compatible"
content="IE=edge,chrome=1">
However, as HTML5 Boilerplate uses conditional comments around the html tag,
IE will render the HTML in Compatibility View , not with Chrome Frame. Hence, us-
ing the meta tag with conditional comments around the html tag would not work.
HTML5 Boilerplate's . htaccess file sets this as an HTTP header instead, as shown
in the following code snippet:
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=Edge,chrome=1"
# mod_headers can't match by content-type,
but we don't want to send this header on
*everything*...
<FilesMatch
"\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$"
>
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>
This forces IE to respect the HTTP header that is sent, and use the latest rendering
engine irrespective of what the meta tag states. You can also set IE to use whatever
rendering engine you like. We discuss this feature in depth in Appendix , You Are an
Expert, Now What? , under the section What is meta x-ua-compatible? .
Search WWH ::




Custom Search