我自己写的代码总是怪怪的,盒子里面的内容不用,就盒子的flex代码就好,或者给个思路也行,谢谢!

写一个大盒子里面左右两个小盒子。右边盒子里面放ul li 标签显示八个小盒子,使用flex布局很好实现


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<style>
.box1 {
width: 1200px;
height: 600px;
display: flex;
}
.box2 {
width: 200px;
height: 600px;
background-color: #4e4e4e;
}
.box3 {
width: 960px;
height: 600px;
background-color: #bbc594;
ul {
display: flex;
flex-wrap: wrap;
li {
display: block;
list-style: none;
background-color: #e7bfbf;
width: 180px;
height: 250px;
margin: 20px;
}
}
}
</style>
<body>
<div class="box1">
<div class="box2"></div>
<div class="box3">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
</ul>
</div>
</div>
</body>
</html>