CSS Flexbox (Part1)

Understanding the Flex Container and Flex Items

The Flexbox model consists of a flex container and flex items. The container is defined using the display: flex; property, and the child elements become flex items.

  • Defining a Flex Container:

In this example, .flex-container is the parent element that will hold the flex items.

Tutorials dojo strip
CSS




Flex Direction

The flex-direction property specifies the direction in which the flex items are placed in the container. The common value are row and column.

  • Setting Flex Direction:

This example sets the flex items to be placed in a row (horizontally) or a column (vertically).

CSS




CSS Flexbox (Part 1) Example Code

CSS




CSS Labs

Tutorials dojo strip