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 Layout Basics Page Layout with the Float Property The Float Challenge Solution

Mike McKnight
Mike McKnight
6,717 Points

I added the clearfix because I knew I had to but I don't think I needed to.

As the question states, I added the clearfix solely because I knew we were supposed to per the instructions. But the way I did my layout nothing really collapsed like Guil's did in the explanation. My code is here https://w.trhou.se/lzn5m02t0d

Any reason why mine didn't? And if not why wouldn't he just do it this way?

1 Answer

Steven Parker
Steven Parker
218,815 Points

I'm not sure why you didn't see it, but if you remove the "clearfix" class from the "container" element, the headers collapses just like in the video.

Also, while it doesn't hurt anything, I noticed that you have two ".clearfix" rules in your CSS.