- When an html element has a property of float then the element after that will float at the end. So, use this clearflix class in an element which has a property float.
- Element with float releases the spaces like absolute positioning. To avoid overlap, the parent element should contain clearfix class.
.clearfix:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.clearfix {
display:inline-block;
}
/*Hides from IE-mac \*/
*html .clearfix{height:1%;}
clearfix{display:block;}end
/*End hide from IE-mac */
/* @end */
Labels: CSS, Web development