Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the new semantic tag of HTML5

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "HTML5 new semantic tag how to use", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "HTML5 new semantic tag how to use" it!

Let's take a look at the picture below.

New semantic tags for HTML5

Header tag

The header tag represents the header part of a page or an area (section), which usually contains a h2-h7 tag to use.

Let's look at the effect on the browser directly through the code.

Header tag effect

Footer tag

The footer tag is similar to the header tag in that it represents the footer of a page or an area (section), where the site's certificates, licenses, copyright agreements, and so on are placed.

Footer tag

Hgroup tag

Hgroup tags are generally used for combinations of h2-h7 tags, such as the combination of main headings, subheadings, and three-level headings.

Let's look at the code organization through the following code snippet.

Hgroup tag

It is important to note that if you need to use the hgroup tag, make sure that there are at least two h tags in the hgroup tag, and if there is only one h tag, you should remove the hgroup tag.

Nav tag

The nav tag is mainly used to define the navigation part of the page, such as the side catalog bar in the page or section.

It is used as shown in the following code snippet.

Nav tag

Aside tag

Aside tags generally specify the relevant content of the web page, links and other annotative things, similar to advertising can also use aside tags.

Main tag

The main tag defines the main content of a page and can only be used once in a page.

Article tag

The article tag represents a separate and complete area of content, such as a separate section of a newspaper.

Other semantic tags can be included inside the article tag, which is basically used as follows.

Article tag

Section tag

Section tags represent sections or segments of the content in the document, the above article,nav or aside can actually be regarded as special section tags, if you can use article,nav,aside tags, it is best not to use section tags.

Section tags and article tags can be nested with each other, depending on the circumstances.

Thank you for reading, the above is the content of "how to use HTML5 new semantic tags". After the study of this article, I believe you have a deeper understanding of how to use HTML5 new semantic tags, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report