采用flex布局时,设置了justify-content: space-between;当一行子元素过多时,就显得比较拥挤,子元素之间的间距就比较小,比如说我想给子元素之间设置一个最小的间距值80px,使相邻的子元素之间的间距不小于80px,如何设置。
<template>
<div>
<div class="out-div">
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="in-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
<div class="none-div"></div>
</div>
</div>
</template>
<style scoped lang="scss">
.out-div {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.none-div {
width: 150px;
}
.in-div {
margin-bottom: 24px;
width: 150px;
height: 150px;
background-color: #1c84c6;
}
</style>