求教js如何实现悬浮式返回网页顶部的
1个回答
展开全部
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{font-size:12px; color:#999; padding:0; margin: 0;}
.backTop{width: 20px; background: #000; text-align: center; padding: 10px 0; font-family: "微软雅黑"; line-height: 14px; position: fixed; top: 30%; right: 0;}
.backTop a{text-decoration: none;}
.backTop:hover{background: orange; }
.backTop:hover a{color: #000;}
</style>
</head>
<body style="height:2000px;">
<div class="backTop"><a href="#">返回首页</a></div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{font-size:12px; color:#999; padding:0; margin: 0;}
.backTop{width: 20px; background: #000; text-align: center; padding: 10px 0; font-family: "微软雅黑"; line-height: 14px; position: fixed; top: 30%; right: 0;}
.backTop a{text-decoration: none;}
.backTop:hover{background: orange; }
.backTop:hover a{color: #000;}
</style>
</head>
<body style="height:2000px;">
<div class="backTop"><a href="#">返回首页</a></div>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询