CSS CSS Flexbox Layout Flexbox Properties Flexbox Properties Review

Megan Case
Megan Case
6,491 Points

Which of the following rules will display the layout shown in the image?

I have tried answering it multiple times but I can never seem to get the correct answer. The options are as follows:

.col { flex: 150%; }

.col { flex: 100px; }

.col { flex: 1; }

Does it have to do with the % vs px? Why can't I find the right answer?

1 Answer

Steven Parker
Steven Parker
176,584 Points

A single value given to the "flex" shorthand is assumed to be a setting for "flex-basis" if it has any unit, and for "flex-grow" if just a number.

Hint: The correct answer is a unitless value that causes each column to take up the same amount of space relative to the others.

Megan Case
Megan Case
6,491 Points

Thank you for your help

Steven Parker
Steven Parker
176,584 Points

Megan Case — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!