position(fixed)--定位

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>position_ example</title>
<style>
.div1{
height:1500px;
background-color:green;
}
.div2{
height:1500px;
background-color:red;
}
a{
position: fixed;
right:20px;
bottom:20px;
}
</style>
</head>
<body>
<div class="div1"><a>return top</a></div><!--return top put in tag div also-->
<div class="div2"></div>
<!--<a>return top</a>-->
</body>
</html>
posted @ 2020-01-10 20:09  Stary_tx  阅读(170)  评论(0编辑  收藏  举报