Flexbox Layout

Table of Contents

Flexbox Layout

Basics

Container

Properties for the Parent (flex container).

flex-direction

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

flex-wrap

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

flex-flow

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

justify-content

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

align-items

.container {
  align-items: stretch | flex-start | flex-end | center | baseline;
}

align-content

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

Items

Properties for the Children (flex items).

order

.item {
  order: <integer>; /* default is 0 */
}

flex-grow

.item {
  flex-grow: <number>; /* default 0 */
}

flex-shrink

.item {
  flex-shrink: <number>; /* default 1 */
}

flex-basis

.item {
  flex-basis: <length> | auto; /* default auto */
}

flex

.item {
  flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
}

align-self

.item {
  align-self: auto | flex-start | flex-end | center | baseline | stretch;
}

Date: 2019-12-28 Sat 23:48

Author: Jack Liu

Created: 2020-02-10 Mon 14:21

Validate