1 回答
TA贡献1777条经验 获得超3个赞
你想要flex-direction: column和flex-wrap:wrap。然后给你的物品高度,以便它们垂直包裹在容器内:
html,body{height:100%;}
.container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
border: solid 2px orangered;
width: 50%;
height: 60%;
box-sizing:border-box;
}
.item {
box-sizing:border-box;
margin: 2px;
}
.one {
height: calc(33% - 4px);
border: solid 2px green;
width: calc(65% - 4px);
}
.two {
height: 40%;
border: solid 2px orange;
width: calc(35% - 4px);
}
<div class="container">
<div class=" item one ">one</div>
<div class="item one ">one</div>
<div class="item one ">one</div>
<div class="item two ">two</div>
<div class="item two ">two</div>
</div>
- 1 回答
- 0 关注
- 155 浏览
添加回答
举报