我需要将项目放在列中,当窗口变窄时,此列会突破到新列,我可以在flexbox中执行此操作吗?
答案 0 :(得分:0)
.flex-container {
display: -webkit-flex;
display: flex;
-webkit-flex-wrap: wrap;
flex-wrap:wrap;
width: 400px;
height: 250px;
background-color: #ccc;
}
.flex-item {
background-color: #050;
width: 150px;
height: 300px;
margin: 10px;
}

<div class="flex-container">
<div class="flex-item">flex item 1</div>
<div class="flex-item">flex item 2</div>
<div class="flex-item">flex item 3</div>
</div>
&#13;