Somewhere around 2003, three major browser vendors: Apple, Mozilla, and Opera founded the WhatWG working group to develop an updated and upgraded version of classic HTML. Their goal was to show that it was possible to extend HTML4 without requiring browsers to implement rendering engines that were incompatible with existing HTML Web pages. In arround the same time W3C group took note of these developments and started its own next-generation HTML. Finally two work groups where joined in 2007 and issued the HTML 5 specification. It is still a work in progress and has a long way to go to become a standard. However newest browsers already support it, and with the release of Firefox 3.5 we will see much more HTML 5 websites.
HTML 5 introduces a whole set of new elements that make it much easier to structure pages. Today HTML pages include a variety of common structures, such as headers, footers, content, right & left blocks. Currently, there is no way in HTML 4 to mark up these elements in a semantic fashion as HTML 4 offers no footer or header elements of its own. During the nineties web designers where using frames to separate page on common structures, with each being a separate html page. With the boom of dynamic web sites this was no longer efficient and developers moved to tables, dividing pages into columns and rows each serving as structure. But as web pages and applications became more complex, usage of tables for structuring pages started to show its flaws. Therefore in early 2000's developers moved to mark up using div elements, giving each a descriptive id or class and then using CSS to style them. Today this practice is mostly used.
Even with well-formed HTML pages it's harder to understand their code or to process them than it should be because of the lack of structure. You have to figure out where the section breaks by analyzing header levels. This is no longer an issue with HTML 5 as it introduces new elements for representing each of these different sections
Header tags can be used for main banners at the top of your web site. A page can contain more than one header, for example each article can have its own header.
The page footer is where the fine print goes; the signature in an e-mail message or copyright at the end of the page. Like a header the footer element can also appear multiple times per page.
Nav tags are used to indicate navigation areas. There can be more than one nav element in a page. Only sections that consist of blocks whose primary purpose is navigation around the site are appropriate to use nav element. Navigation is marked up as an unordered list of links or, in the case of breadcrumb trails, an ordered list.
Article tags are used to define main content on a page. An example would be an entry in a blog or a magazine article.
Aside tags are to be used for marking up sidebars. Sidebar is content that is related to the content around it.
Section tags are used to divide the page if there are no other appropriate structural tags above. It's more than just another kind of div, it imposes a hierarchy upon the content. In a pure HTML 5 world, you would only use h1, and the outlining algorithm would work out the heading level from its context within the pages sections.
For example <section><h1> is a heading 1 and <section><section><h1> becomes a heading 2, and so on.
In this way, we can have more than six levels of headings. However, it's best to continue to use h1-h6 for now, with sections. Browsers have yet to catch up to the new outlining algorithm.
As we see on above picture, pages become more hierarchical and easier to debug.
Video and Audio
In recent years, we have seen a video and audio boom on the web. With sites like YouTube, MySpace, and dozens of others that are making it easy for anyone to publish video and audio. However, since HTML currently lacks the necessary means to successfully embed and control multimedia itself, we are seeing a variety of proprietary media. YouTube uses Flash, Microsoft uses Windows Media, and Apple uses QuickTime. Web authors are interested in providing their own custom-designed user interfaces for media players, which generally allow users to play, pause, stop, seek, and adjust volume. However it is impossible to do it with HTML 4 and CSS, rather one would need to be expert in Flash. This is no longer the case with HTML 5. It provides DOM APIs for scripts to control the playback and CSS to style the user interface. It also defines Ogg Theora the open source codec as the standard for web embedded video.
With the new <video> tag it is as easy to embed video on a web page as just passing source file to video tag:
<video src="example.ogv" width="320" height="240">
<a href="example.ogv">Download movie</a>
Inside the video tag we can insert any html code. This is for backward compatibility with older browsers.
The video tag also has some new attributes:
Autoplay - automatically start playing the video on page load.
Poster - display image before user clicks the play button.
For authors who want a little more control over the user interface so that they can make it fit the overall design of the web page, the extensive API provides several methods and events to let scripts control the playback of the media.
View HTML 5 video example.
It is just as simple to embed audio into a page using the audio element. Most of the attributes are common between the video and audio elements, although for obvious reasons, the audio element lacks the width, height, and poster attributes.
Source tag is to be used for other multimedia types as well as for audio and video with non Ogg Theora codec.
Most of the major browsers include 2D canvas context capabilities - Opera, Firefox, and Safari. In addition, there are experimental builds of Opera that include support for a 3D canvas context, and an add-on that allows 3D canvas support in Firefox.
View canvas examples.