2. it is meaningless to use the header and hgroup to write unnecessary labels when necessary. Unfortunately, I often see meaningless misuse of headers and hgroups. You can read the two articles about the header and hgroup elements for a detailed understanding ...,. 2. Use the header and hgroup only when necessary.
Writing tags that do not need to be written is of course meaningless. Unfortunately, I often see meaningless misuse of headers and hgroups. You can read the two articles about the header and hgroup elements for a detailed understanding. The content is summarized as follows:
-
The header element represents a set of introductory or navigation-oriented secondary texts and is often used as the section header.
-
When the header has a multi-layer structure, such as a sub-head, sub-title, a variety of Logo text, etc., use hgroup to combine h1-h6 elements as the section header
Header abuse
Because the header can be used multiple times in a document, the Code style may be welcomed:
My best blog post
If your header element only contains one header element, discard the header element. Since the article element ensures that the header will appear in the document summary, and the header cannot contain multiple elements (as defined above), why do we need to write redundant code. Simply write it like this:
My best blog post
Incorrect Use
On the topic headers, I often see the incorrect use of hgroup. Sometimes hgroup and header should not be used simultaneously:
The first problem is generally as follows:
My best blog post
By Rich Clark
In this example, remove the hgroup and let the heading go.
My best blog post
by Rich Clark
The second problem is another unnecessary example:
My company Established 1893
If the unique sub-element of the header is hgroup, what about the header? If the header does not contain other elements (such as multiple hgroups), remove the header directly.
My company Established 1893
The above is to avoid the common six HTML5 error usage (2) content. For more information, please follow the PHP Chinese Network (www.php1.cn )!