<div class="item-box">
<div class="item" v-for="item in 5" :key="item">{{item}}</div>
</div>
//伪类添加
<style scoped>
.item-box::after{
content: '';
width: 100px;
height: 0px;
margin: 20px;
}
.item-box{
display: flex;
justify-content: space-around;
background-color: #f5ebeb;
flex-wrap: wrap;
/* 默认nowrap 一行显示 */
}
.item{
width: 100px;
height: 100px;
background-color: skyblue;
margin: 20px;
}
</style>
justify-content: space-around;出现问题:
处理后