Main axis and cross axis

home

Search

Logout

  • The concept of axes is critical to understand to work properly with flexbox.
  • By default flexbox use flex-direction:row so the main axis is horizontal and the cross axis is vertical.
  • But we can changes the axes by using flex-direction, instead of row you can use column.
  • flex-direction:column will place our elements on column and change the main axis by vertical and the cross axis by horizontal.
  • Axis are importants because it will affect properties like justify-content,align-content that we will see later.