HTML <footer> Tag
定义和用法
<footer>
标签定义文档或小节的页脚。
<footer>
元素通常包含:
- 作者信息
- 版权信息
- 联系信息
- 站点地图
- 返回顶部链接
- 相关页面
您可以在一个文档中包含多个 <footer>
元素。
另请参阅:
HTML DOM 参考手册:Footer 对象
实例
例子 1
文档中的页脚部分:
<footer> <p>作者:Bill Gates</p> <p><a href="mailto:bill@example.com">bill@example.com</a></p> </footer>
例子 2
使用 CSS 设置 <footer>
的样式:
<html> <head> <style> footer { text-align: center; padding: 3px; background-color: DarkSalmon; color: white; } </style> </head> <body> <footer> <p>Author: Bill Gates<br> <a href="mailto:bill@example.com">bill@example.com</a></p> </footer> </body> </html>
Tips and Comments
Tip:<footer>
Contact information within the element should be placed <address>
within the tag.
Global Attributes
<footer>
The tag also supports Global Attributes in HTML.
Event Attributes
<footer>
The tag also supports Event Attributes in HTML.
Default CSS Settings
Most browsers will use the following default values to display <footer>
Element:
footer { display: block; }
Browser Support
The numbers in the table indicate the first browser version that fully supports this element.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
5.0 | 9.0 | 4.0 | 5.0 | 11.1 |