Home > Web Front-end > H5 Tutorial > body text

What does hgroup in HTML5 do? The specific usage of the hgroup tag in HTML5 is here. Click here to take a look.

寻∝梦
Release: 2018-08-15 16:36:53
Original
6210 people have browsed it

What does hgroup do in HTML5? The specific usage of the hgroup tag in HTML5 is here. Click here to take a look. This article provides a detailed analysis of the hgroup tag in HTML5, including the specific usage of hgroup in HTML5, how to write the tag, and its functions. I made a detailed analysis, don’t read too much, just read the text. The

tag is new in HTML 5.

The hgroup tag in HTML5 functions as follows:

tag is used to combine the titles of web pages or sections.

tag is used to group the title elements (h1-h6) of a web page or section (DOM interface, settable attributes).

For example, if you have consecutive h-series tag elements in a section, you can use hgroup to enclose them.

The hgroup tag in HTML5 is written as follows:

Use the

tag to combine the titles of web pages or sections.

<hgroup>
<h1>Welcome to my WWF</h1>
<h2>For a living planet</h2>
</hgroup>
<p>The rest of the content...</p>
Copy after login

Use the hgroup tag to display the title group:

<hgroup>
<h3>这是一个列表</h3>
<h3>这是一个列表</h3>
<h3>这是一个列表</h3>
<h3>这是一个列表</h3>
<h3>这是一个列表</h3>
</hgroup>
Copy after login

What is the hgroup element:

The hgroup element is the combination of title and Elements grouped by his subtitles. The hgroup element generally groups h1-h6 elements. For example, the title of a content block and its subtitles are considered a group. Normally, when an article has only one main title, the hgroup element is not needed.

Specific usage of hgroup elements:

Let’s give a detailed demonstration in the development environment:

<article>
<header>
<h1>文章标题</h1>
<p><time datetiem=”2014-10-08”>2014年10月8日</time></p>
</header>
<p>文章正文</p>
</article>
Copy after login

If our article has a main title , and there are subtitles under the main title, then the hgroup element is required.

<article>
<header>
<hgroup>
<h1>文章主标题</h1>
<h2>文章子标题</h2>
</hgroup>
<p><time datetime=”2014-10-08”>2014年10月08日</time></p>
</header>
<p>文章正文</p>
</article>
Copy after login

The effect of these codes can be imagined by yourself^^

When our titles under the same block have main titles and subtitles, we need hgroup elements to wrap them. Although it is rarely used, it is still indispensable. However, this tag was abolished in HTML5.1, but it is still very useful in other versions. Okay, that’s it for this article. If you have any questions, you can ask them.

[Related recommendations]

What is web in HTML5? What are the elements in web storage?

What is the article tag in HTML5? Where is the article element used in HTML5?


The above is the detailed content of What does hgroup in HTML5 do? The specific usage of the hgroup tag in HTML5 is here. Click here to take a look.. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!