css3 子元素平均宽度

这里写图片描述

sass代码

.statistics_box {
    width: 100%;
    height: 100px;
    -webkit-box-orient: horizontal;
    -moz-box-orient: horizontal;
    box-orient: horizontal;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    margin: auto;
    div {
        -webkit-box-flex: 1;
        -moz-box-flex: 1;
        box-flex: 1;
        text-align: center;
        line-height: 100px;
        font-size: 36px;
        color: #fff;
    }
    .statistics_item1{
        background: #1abc9c;
    }
    .statistics_item2{
        background: #3498db;
    }
    .statistics_item3{
        background: #9b59b6;
    }
    .statistics_item4{
        background: #b6b059;
    }
}

对应的css代码

css代码

.statistics_box {
  width: 100%;
  height: 100px;
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;
  box-orient: horizontal;
  display: -webkit-box;
  display: -moz-box;
  display: box;
  margin: auto;
}

.statistics_box div {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  box-flex: 1;
  text-align: center;
  line-height: 100px;
  font-size: 36px;
  color: #fff;
}

.statistics_box .statistics_item1 {
  background: #1abc9c;
}

.statistics_box .statistics_item2 {
  background: #3498db;
}

.statistics_box .statistics_item3 {
  background: #9b59b6;
}

.statistics_box .statistics_item4 {
  background: #b6b059;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值