首页 > 代码库 > fixed应用

fixed应用

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.bg{
width: 100%;
height: 1800px;
background: #000;
}
.Bg{
height: 200px;
width:100%;
background: red;
position: fixed;
opacity: 0.2;
}
</style>
</head>
<body>
<div >
<div class="Bg"></div>
<div class="bg"></div>
</div>
</body>
</html>

fixed应用