解决弹性布局使用justify-content:space-between后最后一行多个元素排版问题

当一行有三个元素的时候直接加个伪类就行,三个以上就需要加占位元素了

<div class="hot-content">

  <div class="hotList"></div>

  <div class="pick"></div>

  <div class="pick"></div>

一行显示五个,多余换行

.hot-content{
    width: 100%;
    display:flex;
    justify-content: space-between;
    flex-wrap: wrap;
    text-align: justify;

}
.hot-content:after{
    content: '';
    width: 19%;
}
.pick{
    width: 19%;
    overflow: hidden;
}
.hotList{
    width: 19%;
    content: '';
    overflow: hidden;
    /* margin-right: 1.25%; */
    border-radius: 5px;
    margin-bottom: 1rem;
}
 
 
四列加一个pick,五个加俩,一次类推
posted on 2020-02-03 17:14  万能的李大少  阅读(5324)  评论(0编辑  收藏  举报