flex弹性布局兼容写法

今天在写h5活动的时候,使用到了flex布局,在chrome浏览器手机模式下测试一切ok,然后使用真机(iphone 5c)时,就发现了各种问题?

在网上找了下flex布局的各种兼容写法,特此记录下

原文地址:弹性布局各种坑爹兼容

 

display:flex的兼容写法

display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -weblit-flex;
display: flex;

定义子元素换行flex-firection的兼容性写法

-webkit-box-orient: verical;
-webkit-box-direction: normal;
-moz-box-orient: verical;
-moz-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;

用box-orient:horizontal+box-direction:normal/reverse可以达到flex-direction:row/row-reverse效果
用box-orient:vertical+box-direction:normal/reverse可以达到flex-direction:column/column-reverse效果

定义子元素换行flex-wrap的兼容性写法

-webkit-flex-wrap: wrap;
-webkit-box-lines: multiple;
-moz-flex-wrap: wrap;
flex-wrap: wrap;

flex-flow: flex-direction flex-wrap的兼容写法

-webkit-flex-flow: row wrap;
-webkit-box-orient: horizontal;
-webkit-box-lines: multiple;
-moz-flex-flow: row wrap;
box-orient: horizontal;
box-lines: multiple;
flex-flow: row wrap;

横向排列布局justify-content的兼容写法

-webkit-justify-content: center;
justify-content: center;
-moz-box-pack: center;
-webkit-box-pack: center;
box-pack: center;

竖向排列布局align-items的兼容写法

-webkit-align-items: center;
align-items: center;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;

伸缩盒子布局的兼容写法

-webkit-box-flex: num;
-moz-box-flex: num;
box-flex: num;
-webkit-flex: num;
flex: num;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值