I'm Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with HTML, CSS and SVG. To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

my books

Pro CSS3 Animation, Apress, 2013

Using SVG with CSS3 and HTML5, O'Reilly, 2017

my other blogs

Massive Head Canon: Intelligent discussion of movies, books, games, and technology.

my projects

The New Defaults — A Sass color keyword system for designers. Replaces CSS defaults with improved hues and more memorable, relevant color names.

CSSslidy — an auto-generated #RWD image slider. 3.8K of JS, no JQuery.

Applying ChromeFrame

Smack IE upside the head with a giant cluebat.

ChromeFrame is an Internet Explorer plugin that essentially “zombifies” the browser: installing a plugin (which does not require an administrator name or password) that replaces IE’s own rendering engine, transforming the browser into “Chrome with an IE face”. In my opinion ChromeFrame remains the best and most complete way of bringing IE 6 – 9 “up to speed” with current web standards. (Popular alternatives take the form of JavaScript “shims” such as Modernizer, requiring far more work).

Indicating that you want Internet Explorer users who visit your site with ChromeFrame already installed to use the Chrome component is easy: it’s just a meta tag in the <head> section of your document:

  1. <meta http-equiv="X-UA-Compatible" content="chrome=1" />

If you want to have ChromeFrame render the page only if the version of IE is 8 or lower, the meta tag becomes:

  1. <meta http-equiv="X-UA-Compatible" content="chrome=IE8" />

Prompting the user to install ChromeFrame is a little trickier, but not difficult. First, you must link to the following script, again in the <head>:

  1. <script type="text/javascript"
  2. src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
  3. </script>

Finally, you need to check if ChromeFrame is installed, and if not, prompt the user to do so. You’ll probably want to delay this until IE has presented the page to the best of its ability, so under the script above, write:

  1. <script>
  2. window.onload=function(){
  3. CFInstall.check({ mode:"overlay", destination:"http://www.domain.com" });
  4. // where the user will be sent after installation
  5. } </script>

If you’re using JQuery instead:

  1. <script>
  2. $(document).ready(function() {
  3. CFInstall.check({ mode:"overlay",
  4. destination:"http://www.demosthenes.info" });
  5. })
  6. </script>

The screen that is generated by JavaScript prompting the user to install ChromeFrame has some CSS hooks. If you want to customize the appearance of the window, add the following classes and declarations to your stylesheet:

  1. .chromeFrameOverlayContent { }
  2. .chromeFrameOverlayContent iframe { }
  3. .chromeFrameOverlayCloseBar { }
  4. .chromeFrameOverlayUnderlay { }

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.