Common misconceptions about the use of inventory HTML5 tags

Source: Internet
Author: User

most In the near group to carry on the HTML5 label's study, the method is everybody chooses several labels, oneself first to study, then gives the explanation to everybody. This process is still very rewarding. But now HTML5 is still in the draft stage, and some of the new labeling elements are often explained, Even the label to move out is also very frequent (such as Hgroup), while the existing large Web portal in the use of HTML5 also have no good examples can be consulted, so that everyone's learning process more groping. Here is an article I saw in the html5doctor above, at present everybody ignorant stage, Perhaps it would be easier to read the master's explanation. As a result of Caishuxueqian, many do not understand the place may just do a literal translation, the wrong place also ask everyone to advise.

In this article I will share with you the small errors and bad practices of the HTML5 build page, and let us avoid these errors in future work.


Don't put

Define styles as simple containers

One of the mistakes we often see is to arbitrarily

Labels are substituted with labels, especially as containers that surround them. In XHTML or HTML4, we will see code similar to the following:


01
<div id= "wrapper" >
<div id= "Header" >
05
Div>
<div id= "Main" >
08
Div>
Ten <div id= "secondary" >
11
Div>
<div id= "Footer" >
14
Div>
Div>

Now I see the following code look:

01
<section id= "wrapper" >
Geneva 05
Header>
<section id= "Main" >
08
Section>
Ten <section id= "secondary" >
11
Section>
<footer>
14
Footer>
Section>

Intuitively, the above example is wrong: not a container. Elements are semantic sections that help build a document outline. It should contain a caption. If you are looking for an element that can contain a page (whether HTML or XHTML), it is common practice to define the style directly to the tag, as Kroc Camen describes it, and if you need additional elements to define the style, use, as Dr Mike explains, the div is not extinct, If there are no more suitable, div may be your most appropriate choice. Remember this, here we have revised the example above, by using two new characters. (Whether you need extra depends on your design.)

Detailed Description: http://html5.662p.com/thread-47-1-1.html

Common misconceptions about the use of inventory HTML5 tags

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.