效果图
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9c7204cd51078cb2e780fafd0e6a22e4.png#pic_center)
<!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>flex超出长度自动换行</title>
<style >
.container{
width: 700px;
border: solid 1px black;
display: flex;
flex-wrap: wrap;
}
.container div{
width: 200px;
margin: 10px;
height: 100px;
background-color: aqua;
flex-shrink: 0;
}
</style>
</head>
<body>
<div class="container">
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
<div class="div4"></div>
<div class="div5"></div>
</div>
</body>
</html>