HTML5
記得我們在以前html5版本以前布局網(wǎng)頁底部版權時,習慣使用id=”footer”或class=”footer”。了解更多html教程標簽!
比如傳統(tǒng)html布局代碼:
? ??DIVCSS5.COM?版權所有
? 學習CSS,找DIV CSS資源上DIVCSS5!?
?
但在html5中將此”footer”常用的命名新增為html5元素標簽成員。
一、html5語法結構 ? - ??TOP
1、語法
?
2、對footer元素標簽加id
?
3、對footer標簽加class
?
4、知識擴展
我們在html5開發(fā)使用footer標簽時,把當作普通div標簽對待即可,只不過一般用于網(wǎng)站底部布局。一般情況下一篇網(wǎng)頁只有一個底部區(qū),所以使用最好只使用一次footer即可。
需要注意:
二、html5 footer使用布局案例 ? - ??TOP
通過傳統(tǒng)div標簽布局與footer標簽布局對比觀察學習,從而掌握footer標簽。同時對footer加class,設置紅色字體進行對比。
1、完整HTML5布局實例代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>footer 在線演示 DIVCSS5</title>
<style> body{text-align:center} /* 傳統(tǒng)布局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>傳統(tǒng)html 使用div布局</p>
<div id="footer">
© DIVCSS5.COM 版權所有
<br /> 學習CSS,找DIV+CSS資源上DIVCSS5!
</div>
<p>html5 footer標簽布局</p>
<footer>
© DIVCSS5.COM 版權所有
<br /> 學習CSS,找DIV+CSS資源上DIVCSS5!
</footer>
<p>html5 footer標簽布局設置class</p>
<footer class="color-F00">
© DIVCSS5.COM 版權所有
<br /> 學習CSS,找DIV+CSS資源上DIVCSS5!
</footer>
</body>
</html>
以上使用傳統(tǒng)html div標簽和html5 footer標簽布局,同時也對footer設置class。
2、HTML5布局瀏覽器截圖

HTML代碼html5 footer布局與瀏覽器瀏覽效果拼接圖
要測試html5 footer標簽布局效果,需要支持HTML5的IE瀏覽器測試。推薦谷歌 chrome瀏覽器、或win IE9以上瀏覽器測試。
以上是HTML5 標簽元素 html底部footer css布局教程的詳細內容。更多信息請關注PHP中文網(wǎng)其他相關文章!