CSS browser compatibility hack encyclopedia

Source: Internet
Author: User

Ie6/7 realize Display:inline-block

There are two ways, the first, to declare the element Display:inline-block, trigger its layout, and then declare it as Display:inline on the second style, such as:

The code is as follows:

. Test{display:inline-block/* Other styles ... * *

. Test{display:inline;}

The second method (recommended) uses the IE6/7 CSS proprietary prefix to trigger the layout (how it feels a bit like JS settimeout):

The code is as follows:

. test{display:inline-block; *zoom:1; *display:inline;}

IE6 Double floating Line spacing

Under IE6, when a div floats to the left in another div and has a margin-left style, then its left margin is the double of the style definition, and the same effect is the same if it floats to the right and margin-right. However, after the floating div's margin is not a problem, but the first one has this problem.

At this point, the solution is: simply add a _display:inline to the div;

Ie6-ie10 CSS Hack

The code is as follows:

p{

Color:black; /*ie10*/

Color:orange; /*ie8,ie9*/

*color:blue; /*ie6,ie7*/

_color:red; /*ie6*/

}

: Root p{

Color:yellow; /*ie9*/

}

IE7/8 under PNG picture background there's something black

That's because you're using a filter effect, like Filter:alpha (opacity=100), and you can just take it off.

IE7/8 element disappears without reason, can't see, Can't click

In other browsers obviously there is something, but came to IE7/8 disappeared without reason. In this case, you try to add background:red to the element, or before you remove the text-indent:-9999em from the text; font-size:0, change to font-size:18px; text-indent:0, you will find that the vanishing element finally appears again. For this method, the workaround is to add a background color to the element under IE7/8. But at the same time you do not want the element to be visible, then add opacity:0; Filter:alpha (opacity=0);

IE7/8 under style loading incomplete

That should be the CSS file CharSet declaration and the file itself coding inconsistency problem, this can be corrected.

First of all, record these, and then continue to update, small partners can also be collected, sent to me, this article continues to update

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.