HTML5页脚
时间:2020-01-09 10:34:38 来源:igfitidea点击:
HTML5footer元素用于在语义上标记页面或者页面各个部分的页脚部分。例如,包含博客文章或者文章列表的页面可能具有整个页面的页脚部分,以及每个博客文章/文章的页脚部分。
这是它在HTML代码中的外观:
<html>
<body>
<header>
<div>
Logo, logo text, top navigation links etc.
</div>
</header>
<nav>
Navigation...
</nav>
<article>
<p>Main content...</p>
</article>
<footer>
Copyright notice, more links etc.
</footer>
</body>
</html>
记住," footer"元素是一个语义元素。它没有任何特殊外观。不过,我们仍然可以使用CSS设置样式,就像使用div元素一样。
还要记住,作为语义元素,我们不必在页面中放入"页脚"元素。 "页脚"元素旨在供未来的智能浏览器(也许)和Web爬网程序等使用,但不能保证这些软件组件将如何使用这些元素。只有未来会证明一切。
文章Elements中的页脚Elements
"文章"元素还可以具有一个页脚部分,也可以将其包含在"页脚"元素中。
这是在HTML5代码中的外观:
<html>
<body>
<header>
<div>
Logo, logo text, top navigation links etc.
</div>
</header>
<article>
<header>
Title, author, rating buttons etc. related to this article.
</header>
<p>
Article text...
</p>
<footer>
Date of publishing or something else...
</footer>
</article>
<footer>
Copyright notice, more links etc.
</footer>
</body>
</html>

