flex-flow CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

组成特性

此特性是下列 CSS 特性的简写:

句法

/* flex-flow: <'flex-direction'> */
flex-flow: row;
flex-flow: row-reverse;
flex-flow: column;
flex-flow: column-reverse;
/* flex-flow: <'flex-wrap'> */
flex-flow: nowrap;
flex-flow: wrap;
flex-flow: wrap-reverse;
/* flex-flow: <'flex-direction'> and <'flex-wrap'> */
flex-flow: row nowrap;
flex-flow: column wrap;
flex-flow: column-reverse wrap-reverse;
/* Global values */
flex-flow: inherit;
flex-flow: initial;
flex-flow: unset;
					

flex-direction and flex-wrap for details on the values.

形式定义

初始值 as each of the properties of the shorthand:
适用于 flex containers
继承 no
计算值 as each of the properties of the shorthand:
动画类型 discrete

形式句法

<'flex-direction'> || <'flex-wrap'>
					

范例

Setting column-reverse and wrap

element {
  /* Main-axis is the block direction with reversed main-start and main-end. Flex items are laid out in multiple lines */
  flex-flow: column-reverse wrap;
}
					

规范

规范 状态 注释
CSS Flexible Box Layout Module
The definition of 'flex-flow' in that specification.
候选推荐 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
flex-flow Chrome 完整支持 29 Edge 完整支持 12 Firefox 完整支持 28
完整支持 28
preference (needs to be set to ). To change preferences in Firefox, visit about:config.
IE 完整支持 11 Opera 完整支持 12.1 Safari 完整支持 9 WebView Android 完整支持 4.4 Chrome Android 完整支持 29 Firefox Android 完整支持 28
完整支持 28
preference (needs to be set to ). To change preferences in Firefox, visit about:config.
Opera Android 完整支持 12.1 Safari iOS 完整支持 9 Samsung Internet Android 完整支持 2.0

图例

完整支持

完整支持

用户必须明确启用此特征。

用户必须明确启用此特征。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: