If you are looking for guidance on using the HTML5 application programming interfaces (APIs), I'm going to paraphrase a line from a great Western movie and say, "I'm not your Huckleberry".
What I would like to look at with you is the 'vocabulary' part of HTML5; its semantics. More succinctly, the way we can use the new elements of HTML5 to describe the content we place in markup. The majority of content in this chapter is not specific to a responsive web design. However, HTML is the very foundation upon which all web-based designs and applications are built. Who doesn't want to build upon the strongest possible foundation?
You might be wondering 'what is HTML5 anyway?' In which case I would tell you that HTML5 is simply the description given to the latest version of HTML, the language of tags we use to build web pages. HTML itself is a constantly evolving standard, with the prior major version being 4.01.
For a little more background on the versions and timeline of HTML's evolution, you can read the Wikipedia entry at http://en.wikipedia.org/wiki/HTML#HTML_versions_timeline.
HTML5 is now a recommendation from the W3C. You can read the specification at http://www.w3.org/TR/html5/.
The topics we will cover in this chapter are:
HTML5 also provides specific tools for handling forms and user input. This set of features takes much of the burden away from more resource heavy technologies like JavaScript for things like form validation. However, we're going to look at HTML5 forms separately in Chapter 9, Conquer Forms with HTML5 and CSS3.
Nowadays, the majority of websites I see (and all of those I make myself) are written using HTML5, rather than the older HTML 4.01 standard.
All modern browsers understand the new semantic elements of HTML5 (the new structural elements, video, and audio tags) and even older versions of Internet Explorer (versions before Internet Explorer 9) can be served a tiny 'polyfill' to allow it to render these new elements.
What is a polyfill?
The term polyfill was originated by Remy Sharp as an allusion to filling the cracks in older browsers with Polyfilla (known as Spackling Paste in the US). Therefore, a polyfill is a JavaScript 'shim' to effectively replicate newer features in older browsers. However, it's important to be aware that polyfills add extra flab to your code. Therefore, even if you could add 15 polyfill scripts to make Internet Explorer 6 render a site identically to every other browser, it doesn't mean you necessarily should.
If you need to enable HTML5 structural elements, I'd look at Remy Sharp's original script (http://remysharp.com/2009/01/07/html5-enabling-script/) or create a custom build of Modernizr (http://modernizr.com). If Modernizr is a tool you've not come across or used, there is a whole section on it in the next chapter.
With that in mind, let's consider the start of an HTML5 page. Let's get a handle on all the opening tags and what they do.