HTML5的<footer>标签元素怎么使用
H5里面增加了一个
HTML5
记得我们在以前html5版本以前布局网页底部版权时,习惯使用id=”footer”或class=”footer”。了解更多html教程标签!
比如传统html布局代码:
<div id=”footer”> 学习PHP,上www.php.cn! </div>
但在html5中将此”footer”常用的命名新增为html5元素标签成员。
html5语法结构
1、语法
<footer> 第一行 学习PHP,上www.php.cn! </footer>
2、对footer元素标签加id
<footer id=”abc”> 第一行 学习PHP,上www.php.cn! </footer>
3、对footer标签加class
<footer class=”yanshi”> 第一行 学习PHP,上www.php.cn! </footer>
4、知识扩展
我们在html5开发使用footer标签时,把当作普通div标签对待即可,只不过一般用于网站底部布局。一般情况下一篇网页只有一个底部区,所以使用最好只使用一次footer即可。
需要注意:
tml5 footer使用布局案例
通过传统div标签布局与footer标签布局对比观察学习,从而掌握footer标签。同时对footer加class,设置红色字体进行对比。
1、完整HTML5布局实例代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>footer </title> <style> body{text-align:center} /* 传统布局CSS */ #footer{color:#CCC; background:#630202;border-top:1px solid #871515; padding:10px 0 30px 0; width:100%} /* HTML5布局样式 直接对footer元素设置样式 */ footer{ background:#CCC;border-top:1px solid #000; padding:10px 0 30px 0; width:100%} .color-F00{ color:#F00} </style> </head> <body> <p>传统html 使用div布局</p> <div id="footer"> 第一行 学习PHP,上www.php.cn! </div> <p>html5 footer标签布局</p> <footer> 第一行 学习PHP,上www.php.cn! </footer> <p>html5 footer标签布局设置class</p> <footer class="color-F00"> 第一行 学习PHP,上www.php.cn! </footer> </body> </html>
以上使用传统html div标签和html5 footer标签布局,同时也对footer设置class
相关推荐
以上是HTML5的<footer>标签元素怎么使用 的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)
