HTML and CSS Reference
In-Depth Information
Discussion
While this technique is effective, it can be cumbersome to create DOM elements for all
of the HTML5 elements on a page, especially if you are making heavy use of many of
them.
Web developer Remy Sharp has created a script that enables all of the HTML5
elements. Integrating this script into your page can be much more convenient than
handcoding a script every time you want to sprinkle some HTML5 into your page. You
can download the script from http://remysharp.com/2009/01/07/html5-enabling
-script/ and integrate it into the head of your HTML, or you can hotlink the script from
the Google code repository:
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
If you wrap this code within this conditional, it will only call the script if the browser
is Internet Explorer 8 or lower (IE9 has broad-range support for HTML5 elements and
technologies).
To make the elements behave as block level elements, set the new
HTML5 elements to display:block in your style sheet.
See Also
John Resig's blog post detailing the HTML shim technique (Resig calls it “shiv” in his
blog post): http://ejohn.org/blog/html5-shiv/ .
2.5 Detecting HTML5 Features with JavaScript
Problem
You want to implement HTML5 features when they're supported by the browser, but
degrade to another solution when they're not.
Solution
HTML5 comes with great cutting-edge technologies that, as a designer, you may be
eager to take advantage of.
Unfortunately, HTML5 currently comes with limited browser support. You might like
to implement some of these new technologies, but you also want to accommodate
browsers that don't yet support them.
 
Search WWH ::




Custom Search