Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Three Column Layout with Flexbox

Why do we target .col instead of .row?

Can someone clarify for me how we know when to target .col instead of .row? I'm not sure I get the significance of targeting the parent div vs. the individual items (sharing the common .col class). gulp

Watching the video till this point, it specifies when to target the parent and the child element. For example, flex grow, basis and shrink don't work on the parent element. In order to use flex grow, you need to target the individual item.

Just the same way you can't use justify-content or align-items on the child element. You can only use align-self. One other property you can't use in the parent element is the Order property.

So we are selecting .col because .row is the parent.

This course clearly explained that. Try going back to see.

1 Answer

Got it, thanks!