Skip to content

Commit

Permalink
Update files/en-us/web/css/css_flexible_box_layout/basic_concepts_of_…
Browse files Browse the repository at this point in the history
…flexbox/index.md

Co-authored-by: Chris Mills <[email protected]>
  • Loading branch information
OnkarRuikar and chrisdavidmills authored Jan 14, 2025
1 parent 9f09505 commit e63fab2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Using `flex: auto` is the same as using `flex: 1 1 auto`; this is similar to `fl

Using `flex: none` will create fully inflexible flex items. It is as if you wrote `flex: 0 0 auto`. The items cannot grow or shrink and will be laid out using flexbox with a `flex-basis` of `auto`.

The shorthand you often see in tutorials is `flex: 1` or `flex: 2` and so on. This is the same as writing `flex: 1 1 0` or `flex: 2 1 0` and so on, respectively. The items get minimum size due to `flex-basis: 0` and then proportionally grow to fill the available space. In this case, the `flex-shrink` value of `1` is redundant because the item starts with minimum size.
The shorthand you often see in tutorials is `flex: 1` or `flex: 2` and so on. This is the same as writing `flex: 1 1 0` or `flex: 2 1 0` and so on, respectively. The items get minimum size due to `flex-basis: 0` and then proportionally grow to fill the available space. In this case, the `flex-shrink` value of `1` is redundant because the items start with minimum size — they're not given any size that could cause them to overflow the flex container.

Try these shorthand values in the live sample below.

Expand Down

0 comments on commit e63fab2

Please sign in to comment.