美文网首页
flex - 四个元素平均分布

flex - 四个元素平均分布

作者: 一沭丶 | 来源:发表于2018-10-31 10:05 被阅读116次
<div class="demo">
   <div class="item"></div>
   <div class="item"></div>
   <div class="item"></div>
   <div class="item"></div>
</div>
.demo{
    width: 250px;
    height: 300px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-center;
    align-items: center;
    justify-content: space-around;
    border: 1px solid blue;
}
.item{
    /* flex: 0 0 40%; */
    width: 100px;
    height: 80px;
    box-sizing: border-box;
    border: 1px solid red
}
image.png

示例地址

相关文章

网友评论

      本文标题:flex - 四个元素平均分布

      本文链接:https://www.haomeiwen.com/subject/qrvotqtx.html