Several ways to clear floating

Source: Internet
Author: User

1: Add floating */* floating element to parent class too much has limitations */

2: Add display:inline-block/* to the parent class * will also apply the element's direct space gap.

3: Add an empty element after the floating element, and set the clear floating clear:both;

4: After floating element <br clear: "All" >/* does not meet the standards */

5: Floating element's parent class Add/* recommend this method */

. Box-set:before,

. box-set:after {

Content: "";

display:table;

}

. box-set:after {

Clear:both;

}

. box-set {

*zoom:1;

/* Compatible with ie6*/

}

6: Parent class Add overflow

/* IE6 Invalid must be added zoom:1 */

/* IE6 floating element If the parent class has a width, you don't have to clear the float */





This article from "Misty Rain Life" blog, please be sure to keep this source http://1095221645.blog.51cto.com/6507311/1889975

Several ways to 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.