HTML5 回到顶部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>回到顶部</title>
<link rel="stylesheet" type="text/css" href="css/try.css" />
<script src="js/app.js"></script>
</head>
<body>
<div class="box">
<img src="img/jkxy.png"/>
</div>
<a style="display:none" href="javascript:;" id="btn" title="回到顶部"></a>
</body>
</html>
*{
margin: 0;
padding: 0;
}
.box {
width:1000px;
margin: 0 auto;
}
#btn {
width:40px;
height: 40px;
position:fixed;
left:50%;
bottom:30px;
background:url(../img/顶部.png) no-repeat left top ;
margin-left: 610px;
}
#btn:hover {
background:url(../img/顶部.png) no-repeat left -40px;
}
全文:https://www.cnblogs.com/guangzhou11/p/7524950.html

浙公网安备 33010602011771号