HTML5, the fifth major modification of the super -text mark language (HTML).
HTML5 contains new elements, attributes and behaviors, and also contains a series of technologies that can be used to make Web sites more diverse and more powerful.
The new features are not available at once, but after the formulation of HTML4.01 (1999), it is constantly changing during this period, and the final manuscript is finalized.
HTML5 standards do not destroy the previous web pages, and web pages that meet the HTML4.01 standard are still effective in HTML5.
Standard URL: https://www.w3.org/tr/html5///
Fixed manuscript time: October 28, 2014
contentCompared with the previous HTML4.01, HTML5 has increased a lot:
① New semantic elements: <Article>, <ASIDE>, <FIGURE>, <FIGCAPTION>, <FOOTER>, <HEADER>, <Hgroup>, <Nav>, <SECTION>, etc.
② New element characteristics: increase new element attributes, table unit elements, verification functions, etc.
③ Multimedia: Add <Audio> audio, <Video> video elements and other content.
④ 2D/3D drawing: Add <CANVAS> drawing element.
⑤ Storage: Increase online and offline storage functions.
⑥ Connectivity: Increase two contents of the client interact with the server: Web Sockets (client and server durable connection) and Server-Seent Events (server push data), etc.
⑦ Integrated: Provide powerful functions such as Web Workers, History API, RequestanimationFrame, and geographical location.
⑧ Device access: Provide support for cameras and mobile devices.
式CSS3 style: provides new background style characteristics, animation, border and other styles.
Browser supportEach mainstream browser is different from HTML5. Among them, IE is the function of supporting HTML5 from the 9th version (not all functions of HTML5).
If you want to know that a function of html5 is supported by each browser, you can log in to http://caniuse.com/ for query.
Taking the <umio> element as an example, you can view the support of each browser:
Create HTML5 pageIntroduce the change of HTML5 from the page.
<! Doctype> Document type declarationThe first line of the traditional HTML page must be a specific document type statement, which is related to the format and layout display page of the browser.
HTML4.01 is based on SGML (standard universal label language), so <! Doctype> quotes DTD.
HTML5 is not based on SGML, so DTD is not required.
Html4.01 page:[Code] <! Doctype html public- // W3C // dtd xhtml 1.0 transitional // en http://www.w3.org/xhtml1/dtdml1-transitudeAl.dtd>
Html5 page:<! Doctype html><html> tag
Set the naming space
The XMLNS attribute in the <HTML> The XMLNS attribute can define one or more optional named spaces. The browser will use this naming space to the elements in the page where the attribute is.
If this attribute is omitted, the default will be replaced by http://www.w3.org/1999/xhtml.
Set page language<html> Lang property in the label can specify the natural language of the page, such as: lang = en means English, and Lang = zh-cn means Chinese. Example:
<html leng = zh-cn> </html><Meta> Tag settings character encoding
<META> Meta-Information can be provided, such as keywords for search engines.
Among them, the Charset attribute defines the character code of the page, which can convert the text content of the page into a specified encoding format during the display.
UTF-8 preferred in web design:
<head> <meta charset = UTF-8/> <Title> Page Title </Title> </Head>Quote style table
Compared with the previous HTML4.01, HTML5 omit the Type = Text/CSS property when the reference style table:
<head> <meta charset = UTF-8/> <Title> Page Title </Title> <link R = STYLESHEET HREF =/Styles/Site.css> </Head>Quote JavaScript file
In HTML5, when quoting the JavaScript file, the Type = Text/JavaScript attribute is omitted:
<head> <meta charset = UTF-8/> <Title> Page Title </Title> <Script SRC =/Scripts/JQURY-1.7.2.JS> </Head> </head>Full page example
Below is a complete HTML5 page:
<! Doctype html> <html lang = zh-cn> <head> <meta charset = utf-8/> <title> Page title </title> <link rel = styleSheet href =/style.css> <script src =/scripts/jquery-1.7.2.js> </script> </head> <body> <p> Body area </p> </body> </html>