Compatibility Issue 2

Source: Internet
Author: User

Problem description
---


In IE6 IE7 IE8 (Q), if the clear attribute is set on a floating element, the floating element is placed on the same line as the floating element in front of it.

In IE6 IE7 IE8 (Q), if the clear property is set to a floating element, the outer top edge of the floating element behind it is higher than the outer top edge of the element.


The impact of---
-
In IE6 IE7 IE8 (Q), the clear attribute is set on a floating element, causing the page layout to be garbled.


--The affected browser
-
IE6 IE7 IE8 (Q)

Problem analysis

For the above two problems, we use the following test cases to illustrate.

Analyze the following code:

<div id= "Container" style= "width:300px; height:200px; border:1px solid red; ">
<div id= "DIV1" style= "float:right; width:150px; height:50px; ">1 float:right;</div>
<div id= "DIV2" style= "clear:right; Float:right; width:250px; height:50px; ">2 Clear:right; Float:right;</div>
<div id= "DIV3" style= "float:left; width:100px; height:50px; ">3 float:left;</div>
/div>

Google and other effects are as follows

<div id= "Container" style= "width:300px; height:200px; border:1px solid red; ">
<div id= "DIV1" style= "float:right; width:150px; height:50px; ">1 float:right;</div>
<div id= "DIV2" style= "clear:right; Float:right; width:250px; height:50px; ">2 Clear:right; Float:right;</div>
<div id= "DIV3" style= "float:left; width:100px; height:50px; ">3 float:left;</div>
</div>
-----


Solution Solutions
---
Do not apply the ' clear ' attribute to floating elements in order to avoid the above incompatibility issues.

Compatibility Issue 2

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.