Home >Web Front-end >HTML Tutorial >Two-point summary of the difference between html header tags and footer tags (with examples of element differences)

Two-point summary of the difference between html header tags and footer tags (with examples of element differences)

寻∝梦
寻∝梦Original
2018-08-30 17:17:598754browse

This article mainly tells you about the two differences between HTML header tags and footer tags. Next, let us take a look at this article about HTML header tags and footer tags

1. Let’s first take a look at the difference between the

tag and the
tag:

The

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

element should serve as a container for introductory content or navigation link bars. Multiple
elements can be defined in a document.

Note: The

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

tag defines the footer of a document or a portion of a document. The

element should contain information about the element it contains.

Typically, this element will contain the name of the document's creator, the document's copyright information, a link to the terms of use, contact information, and so on.

In a document, you can define multiple

elements.

<article>
  <header>
    <h1>这是PHP中文网介绍的页头</h1>
    <p><time pubdate datetime="2011-03-15"></time></p>
  </header>
  <p>Windows Internet Explorer 9 (abbreviated as IE9) 这里是PHP中文网</p>
</article>
<footer>
  <p>这里是PHP中文网中的页脚footer的用法</p>
  <p><time pubdate datetime="2012-03-01"></time></p>
</footer>

Here are the renderings:

Two-point summary of the difference between html header tags and footer tags (with examples of element differences)

2. Let’s now look at another aspect of the difference between the header tag and the footer tag:

header element:

represents a set of instructive content for its nearest parent element. The parent element of the header may be a sectioning element (artic, section, aside, etc.) or a root element (body element). When the closest parent element of the header element is the body element, the header element represents a set of instructive content for the entire HTML page. If there is a new area of ​​content in the HTML document, you can add header elements according to the needs of the content. Doing so will improve the semantics of the document.

footer element:

represents the content of the supplementary description of its nearest parent element. The parent element of footer may be a section element or a root element.

The content of the footer element is usually related to the content of the current region, such as: relevant links, copyright information, etc. of the content of the current region.

When the nearest parent element of the footer element is the body element, then the footer element represents the supplementary description of the entire HTML page.

The footer element is usually used to mark some extended information of the page content, such as appendices, terms, version information, license agreement, or other content.

Here is another example of the difference between header tags and footer tags:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PHP中文网演示</title>
</head>
<body>
<article>
<header>
<h3>文章的标题</h3>
<h5>作者</h5>
</header>
<p>我是正文-我是正文-我是正文-------------<></p>
<article>
<head>
<h4>网友的评论</h4>
<p>评论内容-评论内容-评论内容----------</p>
</head>
<footer>
发布时间:1433223
</footer>
</article>
<footer>
<p>尾部:3000:评论</p>
</footer>
</article>
</body>
</html>

The effect is like this:

Two-point summary of the difference between html header tags and footer tags (with examples of element differences)

The above is the entire content of this article (if you want to see more, welcome to the PHP Chinese website to learn. More programming courses are waiting for you). If you have any questions, you can leave a message below

【Editor’s Recommendation】

html5 What does the header tag mean? Detailed explanation of the usage of html5 header tag (with examples)

How to create a multi-line text input box in the input form? An article teaches you how to use input tags

The above is the detailed content of Two-point summary of the difference between html header tags and footer tags (with examples of element differences). For more information, please follow other related articles on the PHP Chinese website!

Statement:
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