CSS Flexbox (Part 2)

Aligning Items and Content

Flexbox provides properties to align items and content within the flex container.

Tutorials dojo strip
  • align-items: Aligns flex items along the cross axis (vertically in a row, horizontally in a column).
CSS
  • justify-content: Aligns flex items along the main axis (horizontally in a row, vertically in a column).
CSS
  • align-content: Aligns lines of flex items when there’s extra space in the cross axis.
CSS




Flexible Sizing with Flex-grow, Flex-shrink, and Flex-basis

These properties allow you to control how flex items grow, shrink, and set their initial size.

  • flex-grow: Defines how much a flex item should grow relative to the rest.
CSS
  • flex-shrink: Defines how much a flex item should shrink relative to the rest.
CSS
  • flex-basis: Defines the initial size of a flex item before any space distribution occurs.
CSS




CSS Flexbox (Part 2) Example Code

CSS




CSS Labs

Tutorials dojo strip