使用 footer 标签结合 a 标签 可轻松创建页脚链接,先用语义化 footer 定义区域,再添加版权信息、内外链及 邮箱 链接,并通过 css 美化样式,确保路径正确即可。

在 html 页面中添加页脚链接很简单,只需要使用标准的 a 标签(锚标签)结合页脚结构即可。下面是一个简单实用的方法,适合初学者快速上手。
1. 使用 footer 标签创建页脚区域
html5 提供了 footer 语义化标签,用来定义页面底部内容。将链接放入 footer 中,结构更清晰。
<footer> <p>© 2024 我的网站。<a href="https://www.example.com" target="_blank"> 隐私政策 </a> | <a href="/about.html"> 关于我们 </a></p> </footer>
2. 添加常见页脚链接示例
页脚通常包含版权信息、友情链接、联系方式等。以下是一些常用链接写法:
<footer style="text-align: center; padding: 20px;"> <a href="/"> 首页 </a> | <a href="/service.html"> 服务 </a> | <a href="https://blog.example.com" target="_blank"> 博客 </a> | <a href="mailto:support@example.com"> 联系客服 </a> </footer>
3. 简单美化页脚链接样式(可选)
你可以用内联样式或 CSS 让页脚更好看。比如设置颜色、去除下划线等。
立即学习 “ 前端免费学习笔记(深入)”;
<style> footer a {color: #555; text-decoration: none; margin: 0 10px;} footer a:hover {color: #007acc; text-decoration: underline;} </style>
基本上就这些。只要会写 a href,再放进 footer 标签里,就能轻松打出页脚链接。不复杂但容易忽略细节,比如路径写错或没加协议头(http://)。检查一下链接是否能正常跳转就行。


