This chapter will introduce the 6 design principles that HTML5 needs to follow. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Principle 1: 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 2: Support existing content
In the following four pieces of code, only the first paragraph is correct in xhtml; in html5, all of them are Correct
<img src="/static/imghwm/default1.png" data-src="foo" class="lazy" alt="bar" /> <p class="foo">Hello world</p>
<img src="/static/imghwm/default1.png" data-src="foo" class="lazy" alt="bar"> <p class="foo">Hello world
<img src="/static/imghwm/default1.png" data-src="foo" class="lazy" ALT="bar" alt="What are the 6 design principles that HTML5 needs to follow?" > <P CLASS="foo">Hello world</P>
<img src=foo alt=bar> <p class=foo>Hello world</p>
Principle 3: Solve real-life problems
In HTML4, even if two block-level elements have the same link address , must also be written separately, because inline elements cannot contain block-level elements
<h2 id="a-nbsp-href-path-to-resource-Headline-nbsp-text-a"><a href="/path/to/resource">Headline text</a></h2> <p><a href="/path/to/resource">Paragraph text.</a></p>
And in html5, due to the use of the content model, elements can also contain block-level elements
<a href="/path/to/resource"> <h2 id="Headline-nbsp-text">Headline text</h2> <p>Paragraph text.</p> </a>
Principle 4: Seek truth and be pragmatic
html5 has added a number of new elements, including: section, article, aside and nav, which represent a new Content model - Partition content. People have been using divs to organize content on pages in the past, but like other similar elements, divs themselves have no semantics. But section, article, aside, and nav are actually telling you clearly that this section is like another document within the document. Any content located within these elements can have its own summary, its own title, its own footer.
Principle 5: Smooth degradation
When the browser encounters an unrecognized type value, it will interpret 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 first
In case of conflict, the end user takes priority, followed by the author, followed by the implementer, followed by the standard The framer, in the end, is the theoretical perfection.
The above is the detailed content of What are the 6 design principles that HTML5 needs to follow?. For more information, please follow other related articles on the PHP Chinese website!

H5 and HTML5 refer to the same thing, namely HTML5. HTML5 is the fifth version of HTML, bringing new features such as semantic tags, multimedia support, canvas and graphics, offline storage and local storage, improving the expressiveness and interactivity of web pages.

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

The tools and frameworks that need to be mastered in H5 development include Vue.js, React and Webpack. 1.Vue.js is suitable for building user interfaces and supports component development. 2.React optimizes page rendering through virtual DOM, suitable for complex applications. 3.Webpack is used for module packaging and optimize resource loading.

HTML5hassignificantlytransformedwebdevelopmentbyintroducingsemanticelements,enhancingmultimediasupport,andimprovingperformance.1)ItmadewebsitesmoreaccessibleandSEO-friendlywithsemanticelementslike,,and.2)HTML5introducednativeandtags,eliminatingthenee

H5 improves web page accessibility and SEO effects through semantic elements and ARIA attributes. 1. Use, etc. to organize the content structure and improve SEO. 2. ARIA attributes such as aria-label enhance accessibility, and assistive technology users can use web pages smoothly.

"h5" and "HTML5" are the same in most cases, but they may have different meanings in certain specific scenarios. 1. "HTML5" is a W3C-defined standard that contains new tags and APIs. 2. "h5" is usually the abbreviation of HTML5, but in mobile development, it may refer to a framework based on HTML5. Understanding these differences helps to use these terms accurately in your project.

H5, or HTML5, is the fifth version of HTML. It provides developers with a stronger tool set, making it easier to create complex web applications. The core functions of H5 include: 1) elements that allow drawing graphics and animations on web pages; 2) semantic tags such as, etc. to make the web page structure clear and conducive to SEO optimization; 3) new APIs such as GeolocationAPI support location-based services; 4) Cross-browser compatibility needs to be ensured through compatibility testing and Polyfill library.

How to create an H5 link? Determine the link target: Get the URL of the H5 page or application. Create HTML anchors: Use the <a> tag to create an anchor and specify the link target URL. Set link properties (optional): Set target, title, and onclick properties as needed. Add to webpage: Add HTML anchor code to the webpage where you want the link to appear.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use