您的位置:首页 > 其它

19.多盒子嵌套定位

2018-02-03 11:36 162 查看
效果图:



代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>多盒子嵌套定位</title>
<style type="text/css">
.one{
width:500px;
height:500px;
background:red;
position:relative;
}
.two{
width:400px;
height:400px;
background:green;
position:absolute;
}
.three{
width:300px;
height:300px;
background:pink;
position:relative;
}
.four{
width:200px;
height:200px;
background:yellow;
position:absolute;
left:90px;
top:0;
}
</style>
</head>
<body>
<div class="one">
<div class="two">
<div class="three">
<div class="four"></div>
</div>
</div>
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  嵌套