Five things to know about HTML5


1. It’s not one big thing

You may ask, “How can I use HTML5 if older browsers don’t support it?” Actually this question is wrong. HTML5 isn’t one big thing, it’s a collection of different capabilities. You can’t write “HTML5 supported” because it defies common sense, but you can define support for some HTML 5 technologies such as drawing, video, and geolocation.

You can think of HTML as tags and angle brackets. This is certainly an important part, but not all. The HTML5 specification also specifies how these angle brackets interact with JavaScript through the Document Object Model (DOM). HTML5 doesn’t just define the <video> tag, it also tells the DOM about all video objects. You can use the Application Programming Interface (API) to support multiple video formats, play a movie, stop it, mute it, track file downloads, and more, based on user interaction and the <video> tag.

2. You do not need to fold the existing

Whether you like it or not, you cannot deny that HTML4 is the most successful markup format. HTML5 builds on this good fortune, so you don’t have to throw out existing markup and retrain. If your web application runs in HTML4 today, it will also work in HTML5 period.

Here’s a concrete example: HTML5 supports all form elements as HTML4 and also includes new elements. Some of them, like sliders and date picker, have been asking for a long time, others are not so obvious. For example, the field for entering an e-mail address is a regular text field, but modern browsers for this field make it easier to type the address. Older browsers do not support input type = “email”, so they will show a regular text field, and forms will work with it without any additional tweaks. This allows you to improve your forms today, even if some users are still tied to IE6.

3. Easy to get started

“Upgrading” to HTML5 can be done simply by changing the doctype. The <! DOCTYPE> element should always appear on the first line of code in any web page. The previous version of HTML defined multiple doctypes and choosing the right one was not easy. There is only one doctype in HTML5:

<! DOCTYPE html>
Changing the doctype does not destroy the existing layout, because all tags defined in HTML4 are also supported in HTML5. In addition, you can use, and correctly, new semantic elements like <article>, <section>, <header>, and <footer>.

4. It already works

Whether you are looking to draw a drawing, play a video, improve the functionality of forms, or build an offline web application, you will find that HTML5 has excellent browser support. Firefox, Safari, Chrome and mobile browsers work with the <canvas> tag, video, geolocation, local storage, and more. Google understands microdata annotation. Even Microsoft, which usually lags behind the standards, supports basic HTML5 features in its Internet Explorer 9 browser.

All sections of this book contain a compatibility table for popular browsers. More importantly, discussion of options for supporting older browsers is included. HTML5 technologies such as geolocation and video have been implemented using plugins like Gears or Flash. Other features like drawing can be emulated via JavaScript. This book explains how to use the built-in features of modern browsers without dropping older versions.

5. He’s already here

Tim Berners-Lee invented the World Wide Web in the early nineties. He later founded the W3C to Support Web Standards, an organization with more than fifteen years of history. Here’s what the W3C announced about the future of web standards in July 2009:

Management announced today that when the XHTML 2 Working Group charter is completed at the end of 2009, it will not be renewed. This is to enhance the resources of the HTML Working Group. W3C hopes this will speed up the advancement of HTML5 and clarify the W3C position