布局效果:
示例代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.big-box {
width: 1226px;
height: 615px;
background-color: pink;
margin: 0 auto;
}
.left {
float: left;
width: 234px;
height: 615px;
background-color: purple;
}
.right {
float: left;
width: 992px;
height: 615px;
background-color: skyblue;
}
.right>div {
float: left;
width: 234px;
height: 300px;
background-color: blueviolet;
margin-left: 14px;
margin-bottom: 14px;
}
</style>
</head>
<body>
<div class="big-box">
<div class="left">左盒子</div>
<div class="right">
<div>小盒子1</div>
<div>小盒子2</div>
<div>小盒子3</div>
<div>小盒子4</div>
<div>小盒子5</div>
<div>小盒子6</div>
<div>小盒子7</div>
<div>小盒子8</div>
</div>
</div>
</body>
</html>