This chapter will introduce the HTML5 need to follow the 6 design principles, there is a certain reference value, the need for friends can refer to, I hope to help you.
Principle one: Avoid unnecessary complexity
Html4
<! DOCTYPE HTML PUBLIC "-//w3c/dtd HTML 4.01//en" "<meta http-equiv=" Content-type "content=" text/html; Charset=utf-8 ">
Html5
<! DOCTYPE html><meta charset= "Utf-8" >
Principle two: Support existing content
The following four pieces of code, only the first paragraph in XHTML is correct, and in HTML5, everything is correct.
<p class= "foo" >hello world</p>
<p class= "foo" >hello World
<p class= "foo" >hello world</p>
<p Class=foo>hello world</p>
Principle three: Solving the problems of reality
In Html4, even if two block-level element elements have the same link address, they must be written separately, because inline elements cannot contain block-level elements
In HTML5, because the content model is used,<a> elements can also contain block-level elements
<a href= "/path/to/resource" >
Principle Four: Pragmatic
HTML5 adds a number of elements, including sections, article, aside, and NAV, which represent a new content model--to content partitioning. People used to use DIV to organize the contents of the page, but like other similar elements, the DIV itself has no semantics. But section, article, aside, and nav are actually telling you clearly-this piece is just like another document in the document. Any content located within these elements can have its own profile, title, and its own feet.
Principle Five: Smooth degradation
The browser interprets the value of type as text when it encounters an unrecognized type value
Input type= "number" input type= "search" input type= "range" input type= "email" input type= "date" input type= "url"
Principle VI: End user First
Once a conflict is encountered, the end user first, followed by the author, followed by the implementation, and then the standard-setting, and finally the theoretical perfection.