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

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