1猎塞、flex的容器共有六個(gè)屬性
- flex-direction
- flex-wrap
- flex-flow
- justify-content
- align-items
- align-content
2、flex-direction
flex-direction決定主軸的方向,它包括row, row-reverse, column, column四個(gè)值
flex-direction:row;
默認(rèn)是row,從左向右排列元素
屏幕快照 2017-05-15 上午8.47.21.png
flex-direction:row-reverse;
在主軸上從右往左排列
屏幕快照 2017-05-15 上午8.49.08.png
column相似
flex-direction:column;
從上往下排列元素
flex-direction:column-reverse;
從下往上排列元素
2州藕、flex-wrap 折行
它有三個(gè)值:wrap(空間不足時(shí)換行)方援,nowrap(空間不足時(shí)也換行,會(huì)擠在一起,這也是默認(rèn)值)浓领,wrap-reverse(換行,但是第一行在下面)
flex-wrap:wrap;
屏幕快照 2017-05-15 上午9.02.21.png
flex-wrap:wrap-reverse;
屏幕快照 2017-05-15 上午9.03.35.png
3势腮、flex-flow
flex-flow是flex-direction和flex-wrap簡寫形式联贩,默認(rèn)值:
flex-flow:row,nowrap;