<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>绝对定位</title>
<style>
div{
margin: 10px;
padding: 5px;
font-size: 12px;
line-height: 25px;
}
#father{
border: 1px solid #666;
padding: 0;
position: relative;
}
#first{
border: 1px dashed green;
background: #a13d30;
}
#second{
border: 1px dashed blue;
background: #a13d99;
position: absolute;
left: 100px;
}
#third{
border: 1px dashed #b22130;
background: #a99d30;
}
</style>
</head>
<body>
<div id="father">
<div id="first">第一个盒子</div>
<div id="second">第二个盒子</div>
<div id="third">第三个盒子</div>
</div>
</body>
</html>
2021-06-25绝对定位的理解
最新推荐文章于 2024-08-14 15:00:00 发布