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 CSS Flexbox Layout Flexbox Properties Wrapping Items and Distributing Space

mike o'shea
mike o'shea
9,917 Points

css flexbox layout:help needed to question 2.

my answer of flex-direction:column; does not work.

2 Answers

Adam Pengh
Adam Pengh
29,881 Points

flex-direction: column would technically work, but for the challenge, they are looking for the flex items within the flex container to wrap. So you would use flex-wrap: wrap;

mike o'shea
mike o'shea
9,917 Points

works,many thanks,still not sure why

Adam Pengh
Adam Pengh
29,881 Points

The two css rules are very similar. The main difference is that flex-direction sets the layout for all flex items in a container. So if you have 4 flex items and use flex-direction: column; all of those items will be in a column regardless of screen size. Flex-wrap is usually used in conjunction with flex-direction: row; to allow items to wrap at smaller screen sizes.

Hope that helps. :)