Usage of the. Clearfix

Source: Internet
Author: User

/* to fix IE6 . */ . Clearfix {*zoom:1;} . Clearfix:after {content:"."; Display:block; height:0; Clear:both; overflow:hidden;}

The Clearfix is used on the parent element. But what is the role of clearfix:before{}? Can you not write it?

. Clearfix:after{Visibility:Hidden;Display:Block;font-size:0;content: " ";Clear:both;Height:0; }. Clearfix{*zoom:1;}But for many students this level of optimization code is not enough to force, Clearfix developed to the present two Ultimate version. Ultimate Edition One:. Clearfix:after{content:"\200b";Display:Block;Height:0;Clear:both; }. Clearfix{*zoom:1;}/*IE/7/6*/Explanation: Content: "\200b"; this parameter, the Unicode character character has a "0 width space", that is u+200b, instead of the original ".", you can reduce the amount of code. And no longer use Visibility:hidden. Ultimate Edition II:. Clearfix:before,.clearfix:after{content:"";Display:Table; }. Clearfix:after{Clear:both;}. Clearfix{*zoom:1;/*IE/7/6*/}

As you can see, the use of. clearfix:before{} may refer to content: "";

Usage of the. Clearfix

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.