CSS3 Flexbox: Flex-Flow Property

The flex-flow property is a shorthand property for the flex-direction and the flex-wrap properties. The flex-direction property specifies the direction of the flexible items. The flex-wrap property specifies whether the flexible items should wrap or not. See more details here.

The syntax for flex-flow is:

flex-flow: flex-direction flex-wrap|initial|inherit;
HTML file: Displayed by browser:
<style>
.flex-container {
    display: -webkit-flex;
    display: flex;
    width: 400px;
    height: 250px;
    background-color: lightgrey;
}
.flex-item {
    background-color: cornflowerblue;
    width: 75px;
    height: 75px;
    margin: auto;
}
</style>
<body>
<div class="flex-container">
    <div class="flex-item">Perfect centering!</div>
</div>
</body>
Perfect centering!

Note: If the elements are not flexible items, the flex-flow property has no effect.

Back button Table of Contents Next button