Rumah  >  Artikel  >  hujung hadapan web  >  HTML5的<footer>标签元素怎么使用

HTML5的<footer>标签元素怎么使用

php中世界最好的语言
php中世界最好的语言asal
2017-11-22 17:20:377609semak imbas

H5里面增加了一个c37f8231a37e88427e62669260f0074d标签元素,那么我们要怎样使用呢?记得我们在html5版本以前布局网页底部版权时,都会习惯使用id=”footer”或class=”footer”来标记段落,但是在H5里有了这个标签之后,一切都简单了很多。

HTML5 c37f8231a37e88427e62669260f0074d标签元素 新增html5底部footer元素标签,对html 5新增footer标签基础认识到了解footer css布局教程做到真正掌握与认识c37f8231a37e88427e62669260f0074d

记得我们在以前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即可。

需要注意:c37f8231a37e88427e62669260f0074d是html5新增的,在IE8及以下IE浏览器不兼容,谨慎使用。

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

c37f8231a37e88427e62669260f0074d标签的用法就是这么多了,更多精彩请关注php中文网其它相关文章!

相关推荐

html 的1aa9e5d373740b65a0cc8f0a02150c53标签需要怎么使用


html文档类型声明怎么写


css3里怎么显示圆形图片

Atas ialah kandungan terperinci HTML5的<footer>标签元素怎么使用 . Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn