flex布局排列的样式

flex排列布局中尾排不够与上一排的数量相等时,但又采用了justify-content: center;。就会造成排列的混乱,怎么解决这个问题呢

.recharge .recharge-main .recharge-money .mon-bot {

    display: flex;
    margin-top: 30rpx;
    flex-wrap: wrap;
    box-sizing: border-box;
    justify-content: space-between;
    
}

.recharge .recharge-main .recharge-money .mon-bot .money {
    flex-basis: 30%;
    /* box-sizing: border-box; */
    margin-bottom: 10px;
    border: 2px solid #dcdde1;
    padding: 20rpx 0;
    display: flex;
    align-items: center;
    height: 20px;
    justify-content: center;
    
}

//直接在使用了justify-content:center中写margin-right: 34%(百分比是根据自己的效果来调整的)就可以解决了

.recharge .recharge-main .recharge-money .mon-bot .money:last-child:nth-child(3n-1){
    margin-right: 34%;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值