Floated elements will affect the positioning of other elements(e.g. text will flow around floated elements). Unlike absolutely positioned elements which will not affect the position of other elements and other elements will not affect them, whether they touch each other or not.
An element that has the clear property set on it will not move up adjacent to the float like the float desires.
none
- The element is not pushed below left or right floated elements. This is defaultleft
- The element is pushed below left floated elementsright
- The element is pushed below right floated elementsboth
- The element is pushed below both left and right floated elementsinherit
- The element inherits the clear value from its parent.clearfix:after{
content: "";
display: block;
height: 0;
clear:both;
visibility: hidden;
}
.clearfix{
*zoom: 1;
}