CSS CSS Flexbox Layout Flexbox Properties Growing and Aligning Flex Items

Alberto Cruz
Alberto Cruz
4,955 Points

How to make flex items stretch on the cross-axis to fill the parent container.

A challenge is asking me to do this but I know that the default for items is to fill the container vertically...

style.css
/* Complete the challenge by writing CSS below */

.row {
  display: flex;
}

.column {
  align-self: stretch;
}

1 Answer

Garrett Thomsen
PRO
Garrett Thomsen
Pro Student 14,474 Points

i did the challenge and this worked for me

.row { display: flex; }

.column { flex-grow:100% ; }

i went here https://www.w3schools.com/cssref/css3_pr_flex.asp to see info on hiw ti use this.

Alberto Cruz
Alberto Cruz
4,955 Points

Hi Garrett, Thank you. I was able to figure it out. I used flex-grow: 1.