HTML and CSS Reference
In-Depth Information
Here's the final listing, with each element we want to use enabled in IE :
<script>
document.createElement("header");
document.createElement("nav");
document.createElement("article");
document.createElement("section");
</script>
<style>
header, nav, section, article {
padding: 4px; margin: 4px; display: block; }
header { background: #000; color: #999; }
nav { border: 4px solid #000; }
section { border: 4px dashed #000; }
article { border: 2px dotted #000; }
</style>
Enabling HTML5 support in Internet Explorer with html5.js
Rather than work out for yourself what elements you need to fix in
Internet Explorer, you can use one of the freely available compatibility
scripts. A simple one with a good following is html5.js, available at
http://code.google.com/p/html5shiv/ .
Of course, the main drawback of these approaches is that they won't
work if JavaScript is disabled in the browser or if something blocks
your JavaScript from being downloaded, such as a corporate content
filter or a personal firewall. Although this is likely to be a small per-
centage of users for most sites, you should do some analysis of your
existing site visitors before embarking on an HTML5 redesign.
Summary
In this chapter, you've learned about the new markup elements in
HTML5 and the formal structure provided for them, and the elements
inherited from HTML4 , provided by the outlining algorithm and the
content model. You've looked at several popular websites and seen
how the content they display fits naturally into the new semantic ele-
ments of HTML5 , reducing the need for content authors to add seman-
tic meaning to neutral <div> and <span> tags through the id and class
Search WWH ::




Custom Search