HTML5 is the next generation of HTML.
What is HTML5?
HTML5 will be the new standard for HTML, XHTML, and the HTML DOM.
The previous version of HTML came in 1999. The web has changed a lot since then.
HTML5 is still a work in progress. However, most modern browsers have some HTML5 support.
How Did HTML5 Get Started?
HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).
WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.
Some rules for HTML5 were established:
- Reduce the need for external plugins (like Flash)
- Better error handling
- More markup to replace scripting
- HTML5 should be device independent
- The development process should be visible to the public
Some of the most interesting new features in HTML5:
- The canvas element for drawing
- The video and audio elements for media playback
- Better support for local offline storage
- New content specific elements, like article, footer, header, nav, section
- New form controls, like calendar, date, time, email, url, search
The latest versions of Safari, Chrome, Firefox, and Opera support some HTML5 features. Internet Explorer 9 will support some HTML5 features.
HTML 5 improves interoperability and reduces development costs by making precise rules on how to handle all HTML elements, and how to recover from errors.
Some of the new features in HTML 5 are functions for embedding audio, video, graphics, client-side data storage, and interactive documents. HTML 5 also contains new elements like <nav>, <header>, <footer>, and <figure>.
The HTML 5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and many hundreds of other vendors.
Note: HTML 5 is not a W3C recommendation yet!
New Elements in HTML5
The internet has changed a lot since HTML 4.01 became a standard in 1999.
Today, some elements in HTML 4.01 are obsolete, never used, or not used the way they were intended to. These elements are deleted or re-written in HTML5.
To better handle today’s internet use, HTML5 also includes new elements for better structure, drawing, media content, and better form handling.
New Markup Elements
New elements for better structure:
|<article>||For external content, like text from a news-article, blog, forum, or any other content from an external source|
|<aside>||For content aside from the content it is placed in. The aside content should be related to the surrounding content|
|<command>||A button, or a radiobutton, or a checkbox|
|<details>||For describing details about a document, or parts of a document|
|<summary>||A caption, or summary, inside the details element|
|<figure>||For grouping a section of stand-alone content, could be a video|
|<figcaption>||The caption of the figure section|
|<footer>||For a footer of a document or section, could include the name of the author, the date of the document, contact information, or copyright information|
|<header>||For an introduction of a document or section, could include navigation|
|<hgroup>||For a section of headings, using <h1> to <h6>, where the largest is the main heading of the section, and the others are sub-headings|
|<mark>||For text that should be highlighted|
|<meter>||For a measurement, used only if the maximum and minimum values are known|
|<nav>||For a section of navigation|
|<progress>||The state of a work in progress|
|<ruby>||For ruby annotation (Chinese notes or characters)|
|<rt>||For explanation of the ruby annotation|
|<rp>||What to show browsers that do not support the ruby element|
|<section>||For a section in a document. Such as chapters, headers, footers, or any other sections of the document|
|<time>||For defining a time or a date, or both|
New Media Elements
HTML 5 provides a new standard for media content:
|<audio>||For multimedia content, sounds, music or other audio streams|
|<video>||For video content, such as a movie clip or other video streams|
|<source>||For media resources for media elements, defined inside video or audio elements|
|<embed>||For embedded content, such as a plug-in|
The Canvas Element
|<canvas>||For making graphics with a script|
New Form Elements
HTML5 offers more form elements, with more functionality:
|<datalist>||A list of options for input values|
|<keygen>||Generate keys to authenticate users|
|<output>||For different types of output, such as output written by a script|
New Input Type Attribute Values
Also, the input element’s type attribute has many new values, for better input control before sending it to the server:
|tel||The input value is of type telephone number|
|search||The input field is a search field|
|url||The input value is a URL|
|The input value is one or more email addresses|
|datetime||The input value is a date and/or time|
|date||The input value is a date|
|month||The input value is a month|
|week||The input value is a week|
|time||The input value is of type time|
|datetime-local||The input value is a local date/time|
|number||The input value is a number|
|range||The input value is a number in a given range|
|color||The input value is a hexadecimal color, like #FF8800|