# flex-direction

CSS flex-direction 属性指定了内部元素是如何在 flex 容器中布局的,定义了主轴的方向 (正方向或反方向)。

# uni-app x 兼容性

Android iOS web
3.9 4.11 4.0

# 语法

flex-direction: row | row-reverse | column | column-reverse;

# flex-direction 的属性值

row flex 容器的主轴被定义为与文本方向相同。主轴起点和主轴终点与内容方向相同。

row-reverse 表现和 row 相同,但是置换了主轴起点和主轴终点

column flex 容器的主轴和块轴相同。主轴起点与主轴终点和书写模式的前后点相同

column-reverse 表现和column相同,但是置换了主轴起点和主轴终点

# 默认值

平台 默认值
uvue column

注意:W3C 默认值为:row

# 适用组件

# 兼容性

# flex-direction 的属性值兼容性

Android iOS web
row 3.9 4.11 4.0
row-reverse 3.9 4.11 4.0
column 3.9 4.11 4.0
column-reverse 3.9 4.11 4.0

# 浏览器兼容性

Chrome Edge Firefox Opera Safari IE
flex-direction √( 29 ) √( 12 ) √( 81 ) √( 12.1 ) √( 9 ) √( 11 )

# 参见