CSS Basic Tutorial
CSS Flexbox
CSS Flexbox provides several properties to create responsive and flexible layouts. Flexbox includes properties that apply to containers and items.
The element behaves like a block element (takes up the full width available), but its children are laid out using Flexbox.
The element behaves like an inline element (doesn't force a line break and takes only the necessary space), while its children are laid out using Flexbox.
Property |
Applies To |
Description |
---|---|---|
display |
Container |
Defines a flex container. |
flex-direction |
Container |
Sets main axis direction (row/column). |
flex-wrap |
Container |
Enables wrapping of flex items. |
flex-flow |
Container |
Shorthand for |
justify-content |
Container |
Aligns items along the main axis. |
align-items |
Container |
Aligns items along the cross axis. |
align-content |
Container |
Aligns wrapped lines along the cross axis. |
flex |
Items |
Shorthand for grow, shrink, and basis. |
flex-grow |
Items |
Controls how much an item grows. |
flex-shrink |
Items |
Controls how much an item shrinks. |
flex-basis |
Items |
Sets the initial size of the item. |
align-self |
Items |
Overrides |