HTML 5 Preview

Time:2022-5-14

Original text: http://www.alistapart.com/articles/previewofhtml5
By Lachlan Hunt
Translator: zhaozy in 3user com
outline

The network is constantly evolving New and creative websites appear every day, impacting from all aspectsHTMLThe boundary ofHTML4 has been around us for almost 10 years. Publishers are constantly looking for new technologies that provide more powerful functions, but they often have a rough road due to the constraints of markup language and browser
In order to provide authors with more flexible, interoperable, interactive and exciting websites and applications,HTMLIt introduces a series of semantic applications (APIs), including. 5, and enhances the functions of forms and multimedia applications (APIs)
HTML5 work began in 2004 at W3CHTMLWith the joint efforts of WG and whatwg, it is now being fully implemented Many key players have participated in the efforts of W3C. The most representative are the four major browser manufacturers: apple, Mozilla, opera and Microsoft; There are also a range of other institutions and individuals with different interests and expertise
The preparation of detailed specifications is still in progress, and there is still a long way to go before it is completed Similarly, the features discussed in this article do not rule out changes in the future This article is only an outline of some of the main features in the current draft
structure

HTML5 introduces a whole new set of elements to make it easier to build pages Most basedHTMLThe page of 4 contains a variety of common structures, such as header, footer and column At this stage, we usually mark these blocks with div elements, and then define a descriptive ID or class for them


The diagram illustrates a typical two column layout marked with div elements with ID and class attributes It includes a header and footer. Below the header is a horizontal navigation bar, and the main content includes an article and a sidebar on its right
Div elements are used extensively because of the currentHTMLThe lack of a more explicit semantic description of these blocks in version 4HTMLNew elements are introduced to represent these different blocks


Those div elements can be replaced by new elements: header, NAV, section, article, aside and footer
<body>
<header>…</header>
<nav>…</nav>
<article>
<section>

</section>
</article>
<aside>…</aside>
<footer>…</footer>
</body>


Using these new elements will have some advantages (compared withHTML4). When used with title elements (H1 – H6), nested chapter title levels can be marked, surpassing those in previous versionsHTMLThere are only six levels The specification contains a detailed algorithm for generating the outline Take these elements into account and remain backward compatible with previous versions In this way, directories can be generated in editing tools and browsers to help users browse the document
For example, the following tag structure is composed of nested chapters and H1 elements:
<section>
<h1>Level 1</h1>
<section>
<h1>Level 2</h1>
<section>
<h1>Level 3</h1>
</section>
</section>
</section>


It should be noted here that in order to be more compatible with current browsers, it can also use other title elements (H2 – H6) to replace H1 elements in appropriate positions
By identifying the exact purpose of the chapter in the page and using special chapter elements, auxiliary technology can help users browse the page more easily For example, they can easily skip navigation blocks or quickly jump from one article to the next without requiring the author to provide a jump link For the creator, removing redundant divs from the document and replacing them with more obvious elements will make the source code clearer and easier to write

Recommended Today

Use go to realize the public chain function of simple bitcoin blockchain

Use go language to realize a simple blockchain with the following functions Blockchain and blockchain Consensus mechanism database CLI command line operation Transaction management cryptography digital signature Transaction cache pool P2P network management Due to the usual paper work, the project is updated from time to time 2021.1.1 block structure, blockchain structure and workload proof […]