1. <div class="item-box">
    2. <div class="item" v-for="item in 5" :key="item">{{item}}</div>
    3. </div>
    4. //伪类添加
    5. <style scoped>
    6. .item-box::after{
    7. content: '';
    8. width: 100px;
    9. height: 0px;
    10. margin: 20px;
    11. }
    12. .item-box{
    13. display: flex;
    14. justify-content: space-around;
    15. background-color: #f5ebeb;
    16. flex-wrap: wrap;
    17. /* 默认nowrap 一行显示 */
    18. }
    19. .item{
    20. width: 100px;
    21. height: 100px;
    22. background-color: skyblue;
    23. margin: 20px;
    24. }
    25. </style>

    justify-content: space-around;出现问题:
    image.png

    处理后
    image.png