兼容ie10及以上,谷歌等的等高flex自适应写法

单纯的只有一层的话很简单好写,display:table也可以,以下为 li (只是个例子标签,不重要)下面多个几层还能实现其它自适应,小细节忽略

*{
				padding: 0;
				margin: 0;
				box-sizing: border-box;
			}
			.wt50{
				width:50%;
			}
			.wd135{
				width:135px;
			}
			.wdfu135{
				width:calc(100% - 135px);
			}

			.auto-list{
				border: 1px solid #eae7e7;
				min-height: 42px;
				display: flex;
				align-items: stretch;
				display: -ms-flexbox;
				-ms-flex-align: stretch;
				width: 100%;
			}
			.auto-list>li{
				float: left;
				border-right: 1px solid #eae7e7;
				display: flex;
				align-items: stretch;
				display: -ms-flexbox;
				-ms-flex-align: stretch;
			}
			.auto-list>li .flex-item{
				min-height: 100%;
				max-width: 100%;
				display: flex;
				align-items: stretch;
				display: -ms-flexbox;
				-ms-flex-align: stretch;
			}
			.auto-list>li .cen-tag{
				width: 100%;
				word-break: break-all;
			}
			.auto-list .f-item{
				font-size: 15px;
				font-weight: bold;
				border-right: 1px solid #eae7e7;
				float: left;
				line-height: 20px;
				text-align: center;
				display: flex;
				align-items: center;
				justify-content: center;
				display: -ms-flexbox;
				-ms-flex-pack: center;
				-ms-flex-align: center;
				min-height: 41px;
			}
<div style="padding: 50px;">
			<ul class="auto-list">
			   <li class="wt50">
				   <div class="f-item wd135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
				   <div class="f-item wdfu135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
			   </li>
			   <li class="wt50">
				   <div class="f-item wd135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
				   <div class="f-item wdfu135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
			   </li>
			</ul>
			<ul class="auto-list">
			   <li class="wt50">
				   <div class="f-item wd135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
				   <div class="f-item wdfu135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
			   </li>
			   <li class="wt50">
				   <div class="f-item wd135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
				   <div class="f-item wdfu135">
					   <div class="cen-tag">
						   测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字
					   </div>
				   </div>
			   </li>
			</ul>
		</div>

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值