Home >Web Front-end >H5 Tutorial >HTML5 study notes: the difference between html5 and traditional html _html5 tutorial skills
HTML5 study notes: the difference between html5 and traditional html _html5 tutorial skills
WBOYOriginal
2016-05-16 15:46:021842browse
1. Changes in HTML5 syntax The changes mentioned in this knowledge point refer to the changes defined based on HTML4, mainly as follows: 1.HTML5 The file extension (.html or .htm) and content type (text/html) remain unchanged. 2. In HTML5, version declarations are deliberately not used, and one document will apply to all versions of HTML. 3. Starting from HTML5, it is recommended to use UTF-8 for the character encoding of files. 4.HTML5 ensures maximum compatibility with previous HTML versions. In order to ensure compatibility, we need to start with the element. In HTML5., the tag of the element can be omitted. Specifically, the tags of elements are divided into three types: "the end tag is not allowed to be written", "the end tag can be omitted" and "the start tag and the end tag can be omitted". • Closing tag elements are not allowed: area, base, br, col.... • Closing tags can be omitted: li, dt, dd, p, rt... • Both the start tag and the end tag can be omitted: html, head, body.... 2. New structural elements • section element representation A content block in the page, such as a chapter, header, footer or other part of the page; • The article element represents a piece of independent content in the page that is not related to the context, such as an article in a blog or An article in a newspaper; •aside element represents auxiliary information related to the content of the article element in addition to the content of the article element; •header element represents the title of a content block or the entire page in the page ; •hgroup element is used to combine the titles of the entire page or a content block in the page; •footer element represents the footer of the entire page or a content block in the page. Generally speaking, it will contain the name of the creator, the date of creation, and the creator's contact information; •nav element represents the navigation link part of the page; •figure element represents a piece of independent flow content, generally representing a document An independent unit in the main stream content, use the figcaption element to add a title to the figure element group 2. Other new elements • The audio element defines audio, such as music or other audio streams; •The embed element is used to insert various multimedia, the format can be Midi, Wav, AU, MP3, etc.; •The mark element is used to visually present to the user those items that need to be highlighted or highlighted. Text, a typical application is to highlight search keywords to users in search results; •progress element represents a running process •ruby element represents ruby comments (Chinese phonetic or characters) •rt The element represents the interpretation or pronunciation of a character (Chinese phonetic phonetic or character) • The rp element is used in ruby comments to define the content displayed by browsers that do not support ruby elements. •The wbr element represents soft line wrapping, and when the width is not enough, it will actively wrap here •The canvas element represents graphics, such as charts and other images •The cammand element represents command buttons, such as radio buttons , check box or button •The details element represents the detailed information that the user requires and can obtain •The datagrid element represents a list of optional data, which is displayed in the form of a tree list •The keygen element Represents a generated key • The output element represents different types of output, such as the output of a script • The source element defines media resources for media elements (such as
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn