Concise version of HTML5 study notes (1): Introduction and syntax of HTML5
黄舟
Release: 2017-01-21 16:28:42
Original
1246 people have browsed it
HTML5 Introduction
HTML5 is the next generation of HTML standard specification after HTML4. It provides some new elements and attributes (such as
Syntax
1 Document Media Type
Most of the HTML syntax defined by HTML5 is compatible with HTML4 and XHTML1 , but some are incompatible. Most HTML documents are saved as text/html media type.
HTML5 defines detailed parsing rules (including error handling) for HTML syntax, and users must abide by these rules to save it as text/html media type. The following is an example that conforms to the HTML syntax specification:
Example document
Example paragraph
Copy after login
HTML5 also defines a text/html-sandboxed media type for HTML syntax so that untrusted content can be hosted.
Other syntax that can be used in HTML5 is XML, which is compatible with XHTML1. If you use XML syntax, you need to save the document as an XML media type, and set the namespace to http://www.w3.org/1999/xhtml according to the XML specification.
The following example document complies with the XML syntax specification in HTML5. It should be noted that the XML document must be saved as an XML media type, such as application/xhtml+xml or application/xml.
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