效果图
![在这里插入图片描述](https://img-blog.csdnimg.cn/9ca885febe19482db6de761e6d80004d.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5LiA5Y-q5Yuk5aWL55qE5Luj56CB54uX,size_20,color_FFFFFF,t_70,g_se,x_16#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>