Flexbox

A Sane(ish) Standard For Layout and Positioning

Parent Properties

Rules for Containers

Initializing Flex

.container {
    display: flex;
}

//Or

.container {
    display: inline-flex;
}
  • 'flex' adds block element behavior to container
  • 'inline flex' adds inline behavior to container

Flex Direction

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

Specifies Order and Direction of Children

  • row: left to right
  • row-reverse: right to left
  • column: up to down
  • column-reverse: down to up

Children Properties

Rules for Contained Elements

Made with Slides.com