Home > Web Front-end > H5 Tutorial > How to use html5 header tag? Introduction to the role of html5 header tags

How to use html5 header tag? Introduction to the role of html5 header tags

寻∝梦
Release: 2018-09-03 17:32:03
Original
4080 people have browsed it

This article mainly introduces the explanation of the html5 header tag and the introduction of the role of the html5 header tag. Finally, it also provides a summary of the header tag. Let’s read this article together

First of all, we must first understand how to use the html5 header tag?

tag defines the header of a document or a part of a document. The

element should serve as a container for introductory content or a navigation link bar.

In a document, you can define multiple

elements.

Note: The

tag cannot be placed inside a
,
, or another
element.

Introduction to the basic usage of the header tag element:

Before the HTML5 version, it was customary to use div tags to layout web pages. In HTML5, a new header tag element is added based on the DIV tag. Also called "

" header tag. In the past, we often divided web pages into header, content, and bottom in div css layout. For large structures, we often use divs with ids for layout. The header is often laid out using
or
. The characteristics are different from the traditional DIV layout. There is no need for div. tag, but add a new element tag.

It is recognized that "header" is a commonly used name in HTML layout, so a new header tag element is added to HTML5. You can understand why the header is added as a label element in html5.

In addition to using the header tag directly, you can also set class or id to the header.

html5 The syntax structure of the header tag:

The header tag element is used the same as the div. There is a beginning and there is a closure.

<header>php中文网</header>
Copy after login

1. Don’t give id or class directly

<header>头部内容区</header>
Copy after login

2. Set id

<header id=”divcss5”>头部内容区</header>
Copy after login

3. Set class

<header class=”divcss5”>头部内容区</header>
Copy after login

4. Features: like The DIV tag element can be used multiple times, and id or class can be used to set different styles in different places.

html5 Introduction to the role of the header tag:

Because the header tag is a new tag element in HTML5, it is not supported by older versions of browsers and requires IE9 or above browsers. Only supported by the latest browsers such as Google Chrome. Of course, domestic browsers such as 360 Browser, Baidu Browser, and Aoyou Browser all use the IE kernel that comes with the system, so domestic browsers are actually the same version as the IE version that comes with your system, so your IE browser is IE9 or above. The version is naturally compatible with the new tag elements of HTML5.

Summary of the html5 header tag:

PHP Chinese website recommends that in order to be compatible from IE6 to the latest version of IE, it is not time to use html5 new tags for ordinary WEB web page layouts element. It is recommended to use regular DIV CSS to layout html web pages. I usually know that HTML5 has these new tag elements, and I know that the usage method is essentially the same as DIV. Of course, you will naturally use DIV CSS layout and the new element tags in HTML5.

Okay, the above is the introduction and function explanation of the html5 header tag in this article. If you have any questions, you can ask below.

【Editor's Recommendation】

How to center the Chinese characters in the col tag in html? Basic use of html col tags (with examples included)

#How to scale html images to equal proportions? Summary of html img image scaling methods (with examples)

The above is the detailed content of How to use html5 header tag? Introduction to the role of html5 header tags. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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