Introduction to HTML5
HTML5 is the latest revision of HTML, with the standard finalized by the World Wide Web Consortium (W3C) in October 2014.
HTML5 was designed to support multimedia on mobile devices.
HTML5 is simple and easy to learn.
What is HTML5?
HTML5 is the next generation of the HTML standard.
HTML, the previous version of HTML 4.01, was born in 1999. Since then, the Web world has undergone tremendous changes.
HTML5 is still being perfected. However, most modern browsers already have some HTML5 support.
How Did HTML5 Get Started?
HTML5 is the result of cooperation between W3C and WHATWG, where WHATWG stands for Web Hypertext Application Technology Working Group.
WHATWG worked on web forms and applications, while W3C focused on XHTML 2.0. In 2006, the two parties decided to cooperate to create a new version of HTML.
Some 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 special content elements, such as article, footer, header, nav, section
- New form controls, such as calendar, date, time, email, url, search
HTML5
The declaration must be on the first line of an HTML5 document; it is very simple to use:
<!DOCTYPE html>The smallest HTML5 document
The following is a simple HTML5 document:
<!DOCTYPE html><html>
<head>
<meta charset="utf-8">
<title>Document title
title
head
<
body
Document content......
body
html
Note:For Chinese web pages, you need to use the Declare the encoding, otherwise garbled characters will appear.
Improvements in HTML5
- New Elements
- New Attributes
- Full Support for CSS3
- Video and Audio
- 2D/3D Drawing
- Local storage
- Local SQL Data
- Web apps
HTML5 Multimedia
With HTML5 you can easily play video and audio on web pages.
HTML5 Applications
With HTML5 you can easily develop applications
- Local data storage
- Access local files
- Local SQL Data
- Cache references
- JavaScript workers
- XHTMLHttpRequest 2
HTML5 Graphics
With HTML5 you can easily draw graphics:
- Use .
- Using inline SVG。
- Use CSS3 2D Transforms、CSS3 3D Transforms。
HTML5 Uses CSS3
- New Selectors
- New Attributes
- Animation
- 2D/3D Transforms
- Rounded Corners
- Shadow Effects
- Downloadable Fonts
To learn more about CSS3, please see this site's CSS3 tutorial.
Semantic Elements
HTML5 adds many semantic elements, as shown below:
| tag | Description |
|---|---|
| Defines independent content areas of a page. | |
| Defines the sidebar content of a page. | |
| Allows you to set a piece of text so that it is independent of its parent element's text direction. | |
| Defines a command button, such as a radio button, checkbox, or button | |
|
|
Describes the details of a document or a part of a document |
| Defines a dialog box, such as a prompt | |
| The tag contains the title of the details element. | |
|
|
Specifies independent flow content (images, charts, photos, code, and so on). |
|
|
define
|
| Defines the footer of a section or document. | |
|
|
Defines the header area of a document |
| Defines marked text. | |
| Defines a measurement. Only for measurements with known maximum and minimum values. | |
| Defines a section of navigation links. | |
| Defines the progress of a task of any kind. | |
| Defines a ruby annotation (Chinese phonetic notation or character). | |
| Defines the explanation or pronunciation of a character (Chinese phonetic notation or character). | |
| Used inside a ruby annotation to define the content displayed by browsers that do not support the ruby element. | |
| Defines a section in a document (section, subsection). | |
| Defines a date or time. | |
| Specifies where in the text it is appropriate to add a line break. |
HTML5 Forms
New form elements, new attributes, new input types, automatic validation.
Removed Elements
The following HTML 4.01 elements have been removed in HTML5:
Examples in Each Chapter
With our HTML editor, you can edit HTML and then click a button to view the result.
Example
<!DOCTYPE html><
html
<
head
<
meta
charset
=
"
utf-8
"
<
title
Runoob Tutorial(runoob.com)
</
title
</
head
<
body
<
video
width
=
"
320
"
height
=
"
240
"
controls
<
source
src
=
"
movie.mp4
"
type
=
"
video/mp4
"
<
source
src
=
"
movie.ogg
"
type
=
"
video/ogg
"
Your browser does not support the video tag.
</
video
</
body
</
html
Try it »
Click the "Try it" button to view the online result.
HTML5 Browser Support
The latest versions of Safari, Chrome, Firefox, and Opera support some HTML5 features. Internet Explorer 9 will support some HTML5 features.

To make versions below IE9 compatible with HTML5, use the html5shiv package from this site's static resources:
After loading, initialize the CSS for the new tags:
/*
html5
*/
article
,
aside
,
dialog
,
footer
,
header
,
section
,
nav
,
figure
,
menu
{
display:
block
}
HTML5 Reference Manual
On this site you can find descriptions of HTML5 tags and attributes; for details, click HTML5 Reference Manual。