CSS CSS Layout Basics Page Layout with the Float Property Clearing and Containing Floats

William Keely
William Keely
7,295 Points

Overflow part was very unclear.

Why did he bring up the overflow part and then not explain how exactly it was solving the problem? He seemed to just say, "this overflow method works, but here's a better way". I would prefer if he explained exactly how the overflow property was solving the issue and then go on to give us the other solution.

1 Answer

Michael Lambert
Michael Lambert
6,286 Points

The sizing calculations of floated elements are ignored which otherwise would normally be factored in so the container knows how to adjust its height to contain them. By using overflow: hidden for example creates a new block formatting context which forces the container to consider the sizes of the floated elements.