解决弹性布局使用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,五个加俩,一次类推


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM