. Clearfix:after Clear Floating

Source: Internet
Author: User

.clearfix:after{font-size:0; }
. Clearfix{*zoom:1;}


Individual attribute explanations:
. clearfix:after {<----add content to the element in the class named "Clearfix";
Content: ""; <----content.
Display:block; <----This element into a block-level element.
Clear:both; <----clear left and right side floats.
Visibility:hidden; <----visibility is set to hidden. Pay attention to it and display:none; there is a difference. Visibility:hidden, still occupy space, just can't see it;
line-height:0; <----row height is 0;
height:0; <----height of 0;
font-size:0; <----font size is 0, can avoid a lot of empty lines of the bug;
}
. clearfix {*zoom:1;} <----This is for IE6 because IE6 does not support: After Pseudo-class, this magical zoom:1 allows IE6 elements to clear floats to wrap inside elements. The specific meaning, do not have to delve into, heard that Microsoft's engineers themselves can not explain clearly. The height:1% effect is the same.

. Clearfix:after Clear Floating

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.