Best methods for clearing floating in IE7, FF, and OP page 1/2 _ experience exchange

Source: Internet
Author: User
For the optimal method of clearing floating in IE7, FF, and OP, we discuss a margin problem in the CSS Forest Group and inadvertently find that overflow can also be used to clear floating. Hey hey, this method is not just easy to use, in addition, FF, OP, and IE7 are supported. From then on, we can say goodbye to the FF Floating Method with long compatibility.

The method is really simple. You only need to add the overflow attribute to the label that needs to be floating.
Css code

The Code is as follows:


Ul {
List-style: none;
Height: auto;
Margin: 0; p
Adding: 0;
Background-color: #436973;
}
Li {
Float: left;
Width: 80px;
Height: 80px;
Background-color: # 83B1DF;
}
. Demo {
Clear: both;
Border: 1px solid # FF00FF;
Margin-bottom: 5px;
}
. Overflow {
Overflow: auto;
Zoom: 1;
Background-color: #43FF73;
}
Ul {
List-style: none;
Height: auto;
Margin: 0;
Padding: 0;
Background-color: #436973;
}
Li {
Float: left;
Width: 80px;
Height: 80px;
Background-color: # 83B1DF;
}
. Demo {
Clear: both;
Border: 1px solid # FF00FF;
Margin-bottom: 5px;
}
. Overflow {
Overflow: auto;
Zoom: 1;
Background-color: #43FF73;
}


HTML code

The Code is as follows:

Related Article

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.