学习的视频:
最终效果图:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.ysa,.ysb{
width: 300px;
height: 200px;
margin-left: auto;
margin-right: auto;
}
.ysaa{
width: 300px;
height: 50px;
background-color: orange;
}
.ysbb{
width: 100px;
height:150px;
background-color: blue;
float: left;
}
.yscc{
width: 200px;
height:150px;
background-color:green;
float: left;
}
.ysdd{
width: 100px;
height: 200px;
background-color: orange;
float: left;
}
.ysee{
width: 200px;
height: 50px;
background-color: blue;
float: left;
}
.ysff{
width:200px;
height:150px;
background-color: green;
float: left;
}
</style>
</head>
<body>
<div class="ysa">
<div class="ysaa"></div>
<div class="ysbb"></div>
<div class="yscc"></div>
</div>
<hr>
<!-- 接着做第二个嵌套 -->
<div class="ysb">
<div class="ysdd"></div>
<div class="ysee"></div>
<div class="ysff"></div>
</div>
</body>
</html>