css_position_relative_and_absolute

<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta charset="UTF-8">

<style>
.div1{
width: 100px;
height: 100px;
background-color: #fac237;
}
.div2{
width: 100px;
height: 100px;
background-color: #b18621;

top: 100px;
left: 100px;

/*相对*/
/*position: relative;*/

/*绝对*/
position: absolute;
}
.div3{
width: 200px;
height: 200px;
background-color: #77bafc;
}
</style>
</head>
<body>
<div class="div1">11</div>
<div class="div2">22</div>
<div class="div3">33</div>

</body>
</html>
posted @ 2020-06-29 21:02  zxy_ang  阅读(118)  评论(0)    收藏  举报