HTML5實(shí)現(xiàn)錨點(diǎn)時(shí)請(qǐng)使用id取代name
發(fā)布時(shí)間:2013-09-06 18:29:18 作者:佚名
我要評(píng)論

HTML5已經(jīng)去掉name屬性,實(shí)現(xiàn)錨點(diǎn)時(shí)請(qǐng)使用id,下面有個(gè)不錯(cuò)的示例支持Chrome,火狐,IE8以上等瀏覽器,新手朋友們可以學(xué)習(xí)下哦
HTML5已經(jīng)去掉name屬性,實(shí)現(xiàn)錨點(diǎn)時(shí)請(qǐng)使用id,實(shí)例效果:http://keleyi.com/keleyi/phtml/html5/9.htm
支持Chrome,火狐,IE8以上等瀏覽器。
以下是完整代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML5錨點(diǎn)實(shí)例--柯樂(lè)義</title><base target="_blank" />
<style>
body{margin:0px;}
</style>
</head>
<body>
<div id="keleyihead"><a >柯樂(lè)義</a> <a >HTML5錨點(diǎn)</a> keleyi.com
<script type="text/javascript" src="http://keleyi.com/kineryi/js/gggg728x90a.js"></script></div>
<div style="height:30px;width:100%;text-align:center"><a href="#keleyifoot" target="_self">轉(zhuǎn)到底部</a></div>
<div style="background-color:#959822; width:100%;height:150px;">請(qǐng)滾動(dòng)鼠標(biāo)使頁(yè)面向下</div>
<div style="background-color:Green; width:100%;height:150px;">www.keleyi.com</div>
<div style="background-color:Red; width:100%;height:150px;">歡迎</div>
<div style="background-color:Yellow; width:100%;height:150px;">hi</div>
<div style="background-color:Silver; width:100%;height:150px;">
<a target="_blank">綠色箭頭圖片返回頂部效果</a>
<a target="_blank">藍(lán)色方塊返回頂部</a>
<a target="_blank">純文本返回頂部</a>
<a target="_blank">漂亮的返回頂部、底部和留言</a></div>
<div style="background-color:Aqua; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Fuchsia; width:100%;height:150px;">keleyi</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Blue; width:100%;height:150px;">柯樂(lè)義</div>
<div style="background-color:Olive; width:100%;height:150px;">柯樂(lè)義 監(jiān)視下滾像素</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Purple; width:100%;height:150px;">jquery</div>
<div style="background-color:Green; width:100%;height:150px;"><a target="_blank">原文</a></div>
<div style="background-color:Lime; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Orange; width:100%;height:150px;">完整代碼</div>
<div style="height:200px;width:100%;">HTML5已經(jīng)去掉name屬性,實(shí)現(xiàn)錨點(diǎn)時(shí)請(qǐng)使用id</div>
<div id="keleyifoot" style="width:100%;height:276px;background: url(http://keleyi.com/images/footerimg.jpg); background-position:center top; background-repeat:no-repeat;text-align:center;"><a href="#keleyihead" target="_self">回到頂部</a></div>
</body>
</html>
直接轉(zhuǎn)到頁(yè)底示例:
http://keleyi.com/keleyi/phtml/html5/9.htm#keleyifoot
支持Chrome,火狐,IE8以上等瀏覽器。
以下是完整代碼:
復(fù)制代碼
代碼如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML5錨點(diǎn)實(shí)例--柯樂(lè)義</title><base target="_blank" />
<style>
body{margin:0px;}
</style>
</head>
<body>
<div id="keleyihead"><a >柯樂(lè)義</a> <a >HTML5錨點(diǎn)</a> keleyi.com
<script type="text/javascript" src="http://keleyi.com/kineryi/js/gggg728x90a.js"></script></div>
<div style="height:30px;width:100%;text-align:center"><a href="#keleyifoot" target="_self">轉(zhuǎn)到底部</a></div>
<div style="background-color:#959822; width:100%;height:150px;">請(qǐng)滾動(dòng)鼠標(biāo)使頁(yè)面向下</div>
<div style="background-color:Green; width:100%;height:150px;">www.keleyi.com</div>
<div style="background-color:Red; width:100%;height:150px;">歡迎</div>
<div style="background-color:Yellow; width:100%;height:150px;">hi</div>
<div style="background-color:Silver; width:100%;height:150px;">
<a target="_blank">綠色箭頭圖片返回頂部效果</a>
<a target="_blank">藍(lán)色方塊返回頂部</a>
<a target="_blank">純文本返回頂部</a>
<a target="_blank">漂亮的返回頂部、底部和留言</a></div>
<div style="background-color:Aqua; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Fuchsia; width:100%;height:150px;">keleyi</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Blue; width:100%;height:150px;">柯樂(lè)義</div>
<div style="background-color:Olive; width:100%;height:150px;">柯樂(lè)義 監(jiān)視下滾像素</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Purple; width:100%;height:150px;">jquery</div>
<div style="background-color:Green; width:100%;height:150px;"><a target="_blank">原文</a></div>
<div style="background-color:Lime; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Orange; width:100%;height:150px;">完整代碼</div>
<div style="height:200px;width:100%;">HTML5已經(jīng)去掉name屬性,實(shí)現(xiàn)錨點(diǎn)時(shí)請(qǐng)使用id</div>
<div id="keleyifoot" style="width:100%;height:276px;background: url(http://keleyi.com/images/footerimg.jpg); background-position:center top; background-repeat:no-repeat;text-align:center;"><a href="#keleyihead" target="_self">回到頂部</a></div>
</body>
</html>
直接轉(zhuǎn)到頁(yè)底示例:
http://keleyi.com/keleyi/phtml/html5/9.htm#keleyifoot
相關(guān)文章
- 在html中設(shè)置錨點(diǎn)定位我知道的有幾種方法,使用id定位、使用name定位、使用js定位,這些方法大家可以參考下2014-05-28
html 網(wǎng)頁(yè)中的錨點(diǎn)(命名錨記)的使用介紹
html中的錨點(diǎn)想必大家并不陌生吧,錨點(diǎn)是網(wǎng)頁(yè)制作中超級(jí)鏈接的一種,又叫命名錨記,下面以實(shí)例的方式為大家介紹下錨點(diǎn)的使用,不了解的朋友可不要錯(cuò)過(guò)哦2013-11-21ie,360下html錨點(diǎn)失效問(wèn)題解決
ie,360下html錨點(diǎn)失效,想必有不少朋友遇到過(guò)這樣的問(wèn)題吧,下面為大家講解下具體的解決方法,感興趣的朋友可以參考下哈2013-05-13- 很少用到錨點(diǎn)的知識(shí),但今天又看到了,就要記錄下來(lái),它同樣也有著如asp傳值一樣的功效,雖然不是那么強(qiáng)打2010-03-04
HTML中錨點(diǎn)的使用_動(dòng)力節(jié)點(diǎn)Java學(xué)院整理
什么是HTML錨點(diǎn),錨點(diǎn)應(yīng)該如何用?這篇文章主要為大家詳細(xì)介紹了HTML中錨點(diǎn)的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-21