Layout Techniques

Flexbox

Flexbox is a one-dimensional layout method for arranging items in rows or columns.

Untitled

Since flexbox is a whole module and not a single property, it involves a lot of things including its whole set of properties. Some of them are meant to be set on the container (parent element, known as “flex container”) whereas the others are meant to be set on the children (said “flex items”).

Untitled

It is designed to distribute space along a single axis and includes the following key components:

.container{
		display:flex;
}

Untitled

  1. Flex-wrap

Flex-wrap property is used for wrapping flex-items inside the flex-container.

.flex-container {
  display: flex;
  flex-wrap: wrap;
}
.flex-container {
  display: flex;
  flex-wrap: nowrap;
}

Untitled

  1. Flex-flow

This is a shorthand for the flex-direction and flex-wrap  properties, which together define the flex container’s main and cross axes. The default value is row nowrap.