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
167,904 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.