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
The
Note: The
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
<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:
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:
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】
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!