linkedin github twitter

Properties for the Parent
(flex container)

display

This defines a flex container; inline or block depending on the given value. It enables a flex context for all its direct children.

.container {
      display: flex; /* or inline-flex */
    }
Note that CSS columns have no effect on a flex container.

flex-direction

This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside from optional wrapping) a single-direction layout concept. Think of flex items as primarily laying out either in horizontal rows or vertical columns.

.container {
      flex-direction: row | row-reverse | column | column-reverse;
    }

flex-wrap

By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.

.container {
      flex-wrap: nowrap | wrap | wrap-reverse;
    }

flex-flow(applies to: parent flex container element)

This is a shorthand flex-direction and flex-wrap properties, which together define the flex container's main and cross axes. Default is row nowrap.


      flex-flow: <'flex-direction'> || <'flex-wrap'>
Note that CSS columns have no effect on a flex container.

justify-content

This defines the alignment along the main axis. It helps distribute extra free space left over when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow the line.

.container {
      justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly;
    }