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 Basics (2014) Basic Layout Clearing Floats

What does Nick mean when he says it "collapses?

Hey guys and girls,

So I was watching this lesson and following along and of course everything worked as it should, as I am used to by now from Treehouse. So let me take a second to thank the people here for creating these courses.

As for my question. When Nick used the float left (right) he said the content "collapses" around it or something. I don't know how a browser interprets this and causes the collapse. The way I see it is that the floated items literally float up from the page and nest themselves in a new layer or something. I don't get why this happens. Why does the float overlap with the footer? They're totally different lines and should stay clear of each other right? Can someone please elaborate on this and in the process explain why the floated item covers the footer and not, for example, the header or something. You can use abstract examples, I have a pretty vivid imagination so I'll probably understand.

Thank you so much.

1 Answer

Rudy Tan
PLUS
Rudy Tan
Courses Plus Student 16,635 Points

https://css-tricks.com/all-about-floats/

Maybe this post will make it clear for you. Hope it helps you to understand floats.