标签:abs otto class top div The auto web前端 相对
相对定位与绝对定位的练习
.father{
width:600px;
height:400px;
background:#F63;
margin:50px auto;
position:relative;
}
.box1,.box2,.box3,.box4{
width:80px;
height:60px;
background:#F00;
position:absolute;
}
.box2{
right:0;
top:0;
}
.box3{
bottom:0;
right:0;
}
.box4{
bottom:0;
left:0;
}
<div class="father">
<div class="box1">div1</div>
<div class="box2">div2</div>
<div class="box3">div3</div>
<div class="box4">div4</div>
</div>
固定定位
position:fixed
标签:abs otto class top div The auto web前端 相对
原文地址:https://www.cnblogs.com/luckyzyx/p/14064031.html