您的位置:首页 >> 资源中心 >> 软硬件教学 >> 浏览文章

纯css最简单的“返回顶部”效果

时间:2015-01-13 | 栏目:软硬件教学 | 来源:不详 | 编辑:蝌索窝pc354.com | 点击:2858 【点击复制链接】

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>最简单的"返回顶部"效果</title>
<style type="text/css">
.fh{ width:50px; height:50px; background-color: #F0F0F0; border:1px solid #D9D9D9; z-index:1; right:5px; bottom:5px;POSITION:fixed;_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);}
.fh a{ width:50px; height:49px; display:block; text-align:center; line-height:49px; font-size:12px; color:#999999; text-decoration:none;}
.xyz{ width:600px; height:1000px;}
</style>
</head>
<body>
<div class="fh">
<a onclick="goTop();return false;" href="#">回顶部</a>
</div>
<div class="xyz">科杰在线pc354.com</div>
</body>
</html>
  • 软硬件教学
  • 资源收集
  • 生活百科