css--Clear Float

Source: Internet
Author: User

1 //Remove the impact of the float;2 3 //method One: Add Clear:both after the element;4 //1.HTML Block horizontal element Bottom5<div style= "Clear:both;" ></div>6     //inadequate: Causes a lot of bare <div> tags;7 8 //2.CSS after pseudo-element bottom generation9 . Clearfix:after {}Ten     //insufficient: After pseudo-element attribute, IE6/IE7 is not recognized; One  A //method Two: Parent element BFC (ie8+) or haslayout (IE6/IE7); -     float: Left/right; -positoin:absolute/fixed; theOverflow:hidden/scroll; (IE7) -Display:inline-block/table-cell; (ie8+) -width/height/zoom:1; (IE6/IE7) -  + //strategy after trade-offs -. clearfix:after {content: ""; Display:block; height:0; Overflow:hidden; clear:both;} +. clearfix {*zoom:1;} A  at //a better way -. clearfix:after {content: ""; display:table; clear:both;} -. clearfix {*zoom:1;}

css--Clear Float

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.