- 一、弹性盒子父元素的兼容写法:
- display:-webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
- 二、横向排列布局(justify-content)
-
- -webkit-justify-content:center;
justify-content:center;
-moz-box-pack:center;
-webkit--moz-box-pack:center;
box-pack:center;
- -webkit-justify-content:center;
- 三、竖项排列布局(align-items)
- align-items:center;
-webkit-align-items:center;
box-align:center;
-moz-box-align:center;
-webkit-box-align:center;
- 四、伸缩盒子布局兼容 (flex)
-
- -webkit-box-flex: 1;
- -webkit-flex: auto;
- -ms-flex: auto;
- flex: auto;
-
(flex:auto的展开) -
flex-grow: 1; -
flex-shrink: 1; -
flex-basis: auto;
- 五、flex-direction
- -webkit-box-orient:vertical;
-webkit-box-direction:normal;
-moz-box-orient:vertical;
-moz-box-direction:normal;
flex-direction:column;
-webkit-flex-direction:column;
- 六、flex-wrap
- -webkit-flex-wrap:wrap;
-webkit-box-lines:multiple;
-moz-flex-wrap:wrap;
flex-wrap:wrap;
-
3.4 justify-content属性
justify-content
属性定义了项目在主轴上的对齐方式。.box { justify-content: flex-start | flex-end | center | space-between | space-around; }
-
3.5 align-items属性
align-items
属性定义项目在交叉轴上如何对齐。.box { align-items: flex-start | flex-end | center | baseline | stretch; }
- 来自文章
- 兼容性文章