Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the different between clearfix hack and overflow:hidden vs overflow:auto?

Tags:

What is the different between clearfix hack and overflow:hidden vs overflow:auto ?

Are all same thing, which is best?

like image 244
Jitendra Vyas Avatar asked Oct 29 '09 09:10

Jitendra Vyas


People also ask

What is Clearfix hack in CSS?

The clearfix, for those unaware, is a CSS hack that solves a persistent bug that occurs when two floated elements are stacked next to each other. When elements are aligned this way, the parent container ends up with a height of 0, and it can easily wreak havoc on a layout.

When should I use Clearfix?

A clearfix is a way for an element to clear its child elements automatically without any additional markup. The clearfix property is generally used in float layouts where elements are floated to be stacked horizontally.

What is Clearfix float layout?

A clearfix is a way for an element to automatically clear its child elements, so that you don't need to add additional markup. It's generally used in float layouts where elements are floated to be stacked horizontally. The clearfix is a way to combat the zero-height container problem for floated elements.


1 Answers

Ed Eliot has written the definitive guide on the subject.

like image 79
Quentin Avatar answered Oct 05 '22 22:10

Quentin