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 Layout Basics CSS Layout Project Column Layout with Media Queries

How do you determine which are the collapsing containers?

The clearfix worked as shown on the video, but my question is - How do I know which containers I need to apply the class "clearfix" to? How do I know what is collapsing what? In other words I'm confuse which containers I will need to target with the class "clearfix" if I come across this again.

1 Answer

Ash Scott
Ash Scott
435 Points

Hi Luis,

Most of the time, you need to apply a clearfix to a container which has floated items. This brings the height of the container to match the floated items inside, meaning content below doesn't get broken. There can be other usage scenarios, but floated columns are typically when you'd use it most.

Good luck!

Ahhh! Now I see. Thank you so much for your answer Ash!