About Lesson
CSS Flexbox Tutorial
Flex Property | Values | Description | Example Usage |
---|---|---|---|
display: flex; | flex | Sets the element as a flex container, enabling flex properties on its child elements. | <div style="display: flex;">... |
justify-content | flex-start, flex-end, center, space-between, space-around | Specifies how flex items are distributed along the main axis of the flex container.
|
<div style="justify-content: flex-start;">... |
align-items | flex-start, flex-end, center, baseline, stretch | Specifies how flex items are aligned along the cross axis of the flex container.
|
<div style="align-items: flex-start;">... |
flex-direction | row, row-reverse, column, column-reverse | Specifies the direction of the main axis and cross axis within the flex container.
|
<div style="flex-direction: row;">... |
flex-wrap | nowrap, wrap, wrap-reverse | Specifies whether flex items should wrap or stay on a single line.
|
<div style="flex-wrap: nowrap;">... |
flex-grow | number | Specifies the ability for a flex item to grow if necessary within the flex container. | <div style="flex-grow: 1;">... |
flex-shrink | number | Specifies the ability for a flex item to shrink if necessary within the flex container. | <div style="flex-shrink: 1;">... |
flex-basis | length, auto | Specifies the initial size of a flex item before any remaining space is distributed.
|
<div style="flex-basis: 100px;">... |