html中多个div条件互不干扰,css实现多个div在同一行并且div中内容可断行

实现效果:

fdee19b9726eab501cf0c51959d98e7f.png

.all{

display:-moz-box; /* Firefox */

display:-webkit-box; /* Safari and Chrome */

display:box;

width:600px;

height: 600px;

border:1px solid black;

}

.item{

-moz-box-flex:1.0; /* Firefox */

/*-webkit-box-flex:1.0; /* Safari and Chrome */*/

box-flex:1.0;

text-overflow: ellipsis;

display: -webkit-box; /*//将元素设为盒子伸缩模型显示*/

-webkit-box-orient: vertical; /*//伸缩方向设为垂直方向*/

-webkit-line-clamp: 4;  /*//超出3行隐藏,并显示省略号 */

width: 130px;

background: #00F7DE;

line-height:20px;max-height:80px;

height: 80px;

border: 1px solid #000000;

}

L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg
L-测试测试 (99.5%-99.08%) 单位:kg

重点: box-flex 属性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值