Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the design principles to be followed by html5

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Today, I will talk to you about the design principles that html5 needs to follow, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

In fact, html5 is not directly determined by W3C. The direction of W3C is xhtml2, not html5. When xhtml2 was divorced from reality and could not be put into practice, the W3C working group turned its research direction to html5. Why has xhtml2 never been implemented? Because it violates a design principle, which is the famous Bostar law-be conservative when sending and open when receiving. A series of principles are followed in the design process of html5, which makes html5 be promoted rapidly, as follows

Principle 1: avoid unnecessary complexity

Html4

Html5

Html4

Html5

Principle 2: support existing content

Of the following four pieces of code, only the first paragraph is correct in xhtml; in html5, all of it is correct

XML/HTML Code copies content to the clipboard

bar

Hello world

bar

Hello world

bar

Hello world

bar

Hello world

Principle 3: solve practical problems

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

Headline text

Paragraph text.

In html5, elements can also contain block-level elements due to the use of the content model

XML/HTML Code copies content to the clipboard

Headline text

Paragraph text.

Principle 4: be realistic and pragmatic

Html5 has added several elements, including section, article, aside, and nav, which represent a new content model-partitioning content. People used to use div to organize the content of a page, but like other similar elements, div itself has no semantics. But section, article, aside, and nav are actually telling you explicitly-- this piece is just like another document in a document. Any content located in these elements can have its own summary, title, and own feet.

Principle 5: steady degradation

When the browser encounters an unrecognized type value, it interprets the value of type as text

Input type= "number"

Input type= "search"

Input type= "range"

Input type= "email"

Input type= "date"

Input type= "url"

Principle 6: end-user priority

In case of conflict, the end user comes first, followed by the author, the implementer, the standard setter, and finally the theoretical perfection.

After reading the above, do you have any further understanding of the design principles that html5 needs to follow? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report