HTML5完成锚点时请应用id替代name

日期:2020-10-12 类型:科技新闻 

关键词:html网页制作,php网页制作,网页设计稿,网页编辑工具,学生网页设计模板

HTML5早已去掉name特性,完成锚点时请应用id,案例实际效果: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锚点案例--柯乐义</title><base target="_blank" />
<style>
body{margin:0px;}
</style>
</head>
<body>
<div id="keleyihead"><a href="http://keleyi.com">柯乐义</a> <a href="http://keleyi.com/a/bjac/hwqa4oex.htm">HTML5锚点</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">转究竟部</a></div>
<div style="background-color:#959822; width:100%;height:150px;">请翻转电脑鼠标使网页页面向下</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 href="http://keleyi.com/dev/94fb5964c80ee829.htm" target="_blank">翠绿色箭头照片回到顶部实际效果</a>
<a href="http://keleyi.com/a/bjac/7cc2358ac924ebc5.htm" target="_blank">蓝色方块回到顶部</a>
<a href="http://keleyi.com/a/bjac/6f008786225269ac.htm" target="_blank">纯文字回到顶部</a>
<a href="http://keleyi.com/a/bjac/8aa32432160f9aa4.htm" 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;">柯乐义</div>
<div style="background-color:Olive; width:100%;height:150px;">柯乐义 监控下滚像素</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 href="http://keleyi.com/a/bjac/f4a6f78d74a251c5.htm" 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早已去掉name特性,完成锚点时请应用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>

立即转到页底示例:
http://keleyi.com/keleyi/phtml/html5/9.htm#keleyifoot
上一篇:Html5无更新改动browser Url的方式 返回下一篇:没有了