search
HomeWeb Front-endHTML TutorialTwo-point summary of the difference between html header tags and footer tags (with examples of element differences)

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 id="这是PHP中文网介绍的页头">这是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 id="文章的标题">文章的标题</h3>
<h5 id="作者">作者</h5>
</header>
<p>我是正文-我是正文-我是正文-------------<></p>
<article>
<head>
<h4 id="网友的评论">网友的评论</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
What is the difference between an HTML tag and an HTML attribute?What is the difference between an HTML tag and an HTML attribute?May 14, 2025 am 12:01 AM

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The Future of HTML: Evolution and TrendsThe Future of HTML: Evolution and TrendsMay 13, 2025 am 12:01 AM

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.