Grow your CSS skills. Land your dream job.

flex-flow

Last updated on:

The flex-flow property is a sub-property of the Flexible Box Layout module.

It is a shorthand for flex-direction and flex-wrap.

Syntax

flex-flow: <‘flex-direction’> || <‘flex-wrap’>

.flex-container {
  flex-flow: row wrap;
}

You can specify one or two values, no matter the order.

Demo

Both lists behave in the exact same way:

  • The blue one has flex-direction: row and flex-wrap: wrap
  • The red one has flex-flow: row wrap
Check out this Pen!

Related Properties

Other Resources

Browser Support

  • (modern) means the recent syntax from the specification (e.g. display: flex;)
  • (hybrid) means an odd unofficial syntax from 2011 (e.g. display: flexbox;)
  • (old) means the old syntax from 2009 (e.g. display: box;)
Chrome Safari Firefox Opera IE Android iOS
21+ (modern)
20- (old)
3.1+ (old) 2-21 (old)
22+ (new)
12.1+ (modern) 10+ (hybrid) 2.1+ (old) 3.2+ (old)

Blackberry browser 10+ supports the new syntax.

For more informations about how to mix syntaxes in order to get the best browser support, please refer to this article (CSS-Tricks) or this article (DevOpera).

Comments

  1. Hi Chris,

    Just a note that flex-flow: row wrap; (shorthand or long) is only supported in Chrome and Opera right now. The other browsers don’t “wrap” rows yet.

    Here’s your codepen in Firefox 22, Chrome 27, and Safari 6.

    http://i.imgur.com/CAA6IVw.png

    Little more info at

    https://developer.mozilla.org/en-US/docs/Web/CSS/flex-flow

Leave a Comment

Posting Code

Markdown is supported in the comment area, so you can write inline code in backticks like `this` or multiline blocks of code in in triple backtick fences like ```this```. You don't need to escape code in backticks, Markdown does that for you.

Sadly, it's kind of broken. WordPress only accepts a subset of HTML in comments, which makes sense, because certainly some HTML can't be allowed, like <script> tags. But this stripping happens before the comment is processed by Markdown (via Jetpack). It seems to me that would be reversed, because after Markdown processes code in backticks, it's escaped, thus safe. If you think you can fix this issue, get in touch!

If you need to make sure the code (typically HTML) you post absolutely posts correctly, escape it and put it within <pre><code> tags.

Current ye@r *

*May or may not contain any actual "CSS" or "Tricks".