display:flex

display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;      /* TWEENER - IE 10 */
display: -webkit-flex;     /* NEW - Chrome */
display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */
-webkit-box-flex: 1;      /* OLD - iOS 6-, Safari 3.1-6 */
-moz-box-flex: 1;         /* OLD - Firefox 19- */
-webkit-flex: 1;          /* Chrome */
-ms-flex: 1;              /* IE 10 */
flex: 1;                  /* NEW, Spec - Opera 12.1, Firefox 20+ */

flex-direction 定义排列方式

flex-direction: row 从左向右排列,默认值
flex-direction: row-reverse 从右向左排列
flex-direction: column 从上向下排列
flex-direction: column-reverse 从下向上排列
 
flex-wrap 定义是否多行显示
flex-wrap: nowrap 显示单行,默认值
flex-wrap: wrap 从左向右排列,多行显示
flex-wrap: wrap-reverse 从右向左排列,多行显示
 
flex-flow  flex-direction和flex-wrap两个属性的缩写。两个性的值都可以用到此上面单独或多个。默认值是row nowrap,
 

justify-content 用于在主轴(X)上对齐伸缩项目

justify-content: flex-start
 

justify-content: flex-end

 

justify-content: center

 

justify-content: space-between

 

justify-content:space-around

 
align-items 用于在侧(Y)轴上对齐伸缩项目
align-items: flex-start
align-items: flex-end
align-items: center
align-items: stretch
align-items: baseline
 
align-content 调准伸缩行在伸缩容器里的对齐方式
注意:在只有一行的伸缩容器上没有效果
水平垂直居中
display: flex; 
justify-content: center;
align-items: center;
posted @ 2016-10-20 13:54  白色斑马线  阅读(159)  评论(0编辑  收藏  举报