This time I will show you how to use the header tag in H5. How to use the header tag in H5? What are the precautions when using header tags in H5? The following is a practical case, let’s take a look.
The
In the new standard, the header tag is defined as follows:
"A group of introductory or navigational aids."
Basically means "a group of introductory navigation-related auxiliary content." Literally understood, the header tag not only defines the content of the page header, but can also define the introduction of other content below the page header. This is not completely consistent with our traditional page header definition.
Usually the -
), and can also include the tag, and can also include table content, logo, search Forms,
<header> <h1>1</h1> <p>专注于web前端开发</p> </header> <article> <header> <h1>html5语义化标签之结构标签</h1> <p>article、section、hgroup、aside、nav...</p> </header> <p>...这里面包含很多东西...</p> </article>
In the above structure, we can see that using header we define the title and content of an article. The header tag used here is not the header of the page, but the header of the article.
So in HTML5, the use of headers is more flexible, and you can define and organize the document structure according to your needs.
Similarly, when structuring a page, the header tag is generally placed at the top of the page, but if you want to place it on the left, right or even bottom, it doesn’t matter. The tag only defines its location on the page. Role, not location. Of course, it is more based on search engine optimization principles. Important content is finally advanced when structuring the page.
Finally, since header is a block element in HTML5, if we want to use it in most mainstream browsers, it is best to define CSS, as follows.
header { display:block;}
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
How to use regular expressionsCatch the list data of the blog garden
What kind of regular expressions The formula can display highlight highlighting
How to use jquery's ajax to asynchronously submit form data
The above is the detailed content of How to use header tags in H5. For more information, please follow other related articles on the PHP Chinese website!