What are the 6 design principles that HTML5 should follow?

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.