Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Flexbox code challenge help please

Challenge Task 1 of 2

Set the columns to expand and display on one line when they are 300px or wider. But when the columns are narrower than 300px, the browser will redistribute the space and display them on multiple lines.

.row { display: flex; }

Could someone please help me here, my attempts are not working and I am starting to confuse myself. Thank you.

6 Answers

Hi Tracy Excell,

to do that you have to told to the container, in this case the class .row to distribute the child element like this

.row {
display: flex;
justify-content: space-between; /* or space-around */
flex-flow: row wrap;
}

after that you have to select the child element (the elements inside the row class) and tell that their min-width is 300px

.row {
display: flex;
justify-content: space-between; /* or space-around */
flex-flow: row wrap;
}

.child {
flex: 1;
min-width: 300px;
}

I also recommend you to look at this page. A great guide to css flexbox.

Thank you

Glad that I help you! Happy coding!

It doesn't work for my workspace.

.row { display: flex; justify-content: space-between; /* or space-around */ flex-flow: row wrap; }

.column{ flex: 1; min-width: 300px; }

This code doesn't work in my exercise.

Hi Filip Cimbaljevic,

could you post your code?

.row { display: flex; justify-content: space-between; /* or space-around */ flex-flow: row wrap; }

.column { flex: 1; min-width: 300px; }

It's the same code that you written 5 days ago. I've only changed the class name into .column, and it doesn't work. So please tell me what's wrong with code. Thanks!

This is the error message that I get: " Bummer! Use the property that specifies the initial main size of the columns. "

I found it. Thanks anyway. This is code. It's simple.

.row {

display: flex;

justify-content: space-between;

}

.column {

flex: 1 300px;

flex-flow: row wrap;

}

Good job!!

the only thing is the property flex-flow need to applied to the parent element, in this case the class .row!

Ok. Thank you again!