Get the App
SLTechnology News&Howtos  ›  Development  › 

How to determine whether div is a html5 semantic tag

Shulou Source: shulou.com Published: 2022-06-02 03:11:11 10月03日 Update

Today, the editor will show you how to judge whether div is a semantic tag of html5. The knowledge points in the article are introduced in great detail. Friends who feel helpful can browse the content of the article with the editor, hoping to help more friends who want to solve this problem find the answer to the problem. Follow the editor to learn more about "how to judge whether div is a semantic tag of html5".

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

In the previous web front-end development of html5, we used div to achieve region segmentation.

So is div a html5 semantic tag?

Div is not a html5 semantic tag.

Div is a non-semantic tag that is mainly used to define a separated block or part of a region in an HTML document. It is often used to combine block-level elements so that they can be formatted through CSS.

We often use multiple div tags in a web page, but the div tag can not clearly indicate the meaning of the content in this area, which is very unfriendly to our next css style setting and later maintenance, so in html5, there are some semantic tags, today we come to understand these tags.

What is semantics?

Semantics refers to formatting the content of a document with reasonable HTML tags and their unique attributes. In popular terms, semantics is the processing of data and information so that machines can understand it.

Document title subtitle

This is an article paragraph, which generally contains more content than other HTML tags. Paragraphs are basically full of text, usually 3-6 lines, or more than 10 lines. It is the main reading part of the web page.

These are very common semantic tags of text. When we set up the structure of a web page, we can also use semantic tags to make the structure of the page clear and easy to understand.

The first child element of body, which is used to represent the header of a page or an area. The content is displayed on the page and can appear multiple times on a page.

: represents the navigation bar. Descendant elements have tags and links. A page can have multiple nav tags.

Used to express additional information related to the surrounding topic, non-text content, sidebar, AD (advertisement), related articles, comments

: used to represent the content of articles or other independent pages (the content of independent articles, keywords that need to be crawled by search engines also need to be placed on this tag) comments can also be written on this tag, and a page can use multiple article

Used to represent a part of a topic as a whole, such as the chapter title of an article, which is a child element of article

A footnote used to represent a page or an area, which can appear multiple times

: mainly, a page can only appear once and can contain article

Thank you for your reading. The above is the whole content of "how to judge whether div is a html5 semantic tag". Friends who learn it, hurry up and do it. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!

Tags: Tags semantics content pages articles elements regions multiple that is documents friends titles paragraphs web pages parts topics information formats knowledge structure Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Apple Shulou Information MariaDB Microsoft