代码实现如下:
<!DOCTYPE html>
<html
lang="en">
<head>
<meta
charset="UTF-8">
<style>
#back{
width:
100px;
height:
100px;
background-color:
red;
text-align:
center;
line-height:
100px;
position: fixed;
bottom:
20px;
right:
20px;
}
</style>
<title>固定定位</title>
</head>
<body>
<div
style="height:
2000px;;"><a
name="bbc"
>在这里</a></div>
<hr/>
<div
style="height:
1000px">
<div
id="back">
<a
href="#bbc">返回顶部</a>
</div>
</div>
</body>
</html>