先上效果图:
再来代码:
<body>
<section>
<ul class="box">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</section>
</body>
<style>
html,body,section{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
ul,li{
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
.box{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content:space-between;
background: darkseagreen;
}
.box li{
width: calc(50% - 5px);
height: 100px;
background:mistyrose;
margin: 5px 0;
}
</style>
代码橙色部分为关键。运用C3的