Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML5 Tutorial

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:


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


HTML5 Multimedia

With HTML5 you can easily play video and audio on web pages.


HTML5 Applications

With HTML5 you can easily develop applications


HTML5 Graphics

With HTML5 you can easily draw graphics:


HTML5 Uses CSS3

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
The title of an element
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: