CSS compatibility issues Summary

Source: Internet
Author: User

Problem

Browser

Workaround

Body{overflow:hidden;} No scroll bar removed

Ie6/7

Set Html{overflow:hidden;}

Form>[haslayout] element has margin-left, [input | textarea] in the child element appears 2xmargin-left

Ie6/7

form > [haslayout element]{margin-left: width;}
Form div{*margin-left: Width ÷2;}

When the child element has position:relative, the parent element setting Overflow:[hidden|auto] is equivalent to setting the child element

position:visible; (overflow not hidden)

Ie6/7

Sets the position:relative for the parent element;

Th does not automatically inherit the text-align of the ancestor element

IE8

Add Text-align:inherit to th;

: hover if Background-color is #fff, failure

IE7

Change the background-color into a background. Or, non-#fff | | #ffffff

Position:absolute element, a display:block, when: hover only text can be clicked, when no text is not clickable

Ie6/7

Add background to A, if the background is transparent, using background:url (' file link already cached on any page '), Background:url (#) [Official workaround] is not recommended because an HTTP request will be added

DT, DD, Li background failure

IE6

DT, DD, li{position:relative;}

Transparent part of a transparent background image processed with filter is not available.

Ie6-8

Turn Background:none into Background:url (' link '), link to itself and any file outside of the picture

Li inner element deviates from baseline downward pull

IE8

Set Display:inline or float:[direction for Li]

The list-style of Li in the list does not appear

Ie6/7

Add Margin-left to Li, leave room for display (do not add to UL)

Background overflow, display normal after dragging scroll bar

IE6

Add Overflow:hidden to the parent element to prevent overflow and give haslayout, if added _zoom:1;

Higher than the height definition

IE6

Add _overflow:hidden; (recommended) or _font-size:0;

Width is greater than widths defined

IE6

Add _overflow:hidden;

Double margins

IE6

Add Display:inline to float element

Margin negative hidden: non-haslayout elements within the parent element of the haslayout, when negative margins are used, are not visible outside the parent element part

Ie6/7

Remove the haslayout of the parent element, or assign haslayout to the child element and add position:relative;

Set the text of one of the two floating elements to italic, and the other to the bottom of the italic text element.

IE6

Add Overflow:hidden to elements with italic text;

3PX interval: A fixed-width element after the float element, with a 3px interval

IE6

Because it is the exact 3px, so, with "brute force", such as _margin-left:-3px;

Text-align affects block-level elements

Ie6/7

Organize your float, or set text-align separately

Floating element cannot open parent element

Ie/ff

Ff/ie6 above: Overflow:hidden

Ie6:zoom:1;

A adds a PNG background and the connection fails.

Links that are commonly used in logos

Ie6

Add a parent div to the logo to put PNG into the Div BJ and then give a plus position:relative;

Li's width:auto when doing horizontal navigation; A link to the Width:auto;

Ie6 width as a whole line

Ie6

_width:0; White-space:nowrap;

TABLE/TR set Display:block; When the content is squeezed into a piece

Ff/chrome

Be sure to set the time can be so display:;

min-height:500px;

Ie6

IE6 does not support the Min-height property. To IE6 add _height:500px, remember not to add Overflow:hidden; Inside the IE6, if the content exceeds the height specified by height, the container will be stretched.

Text automatically applies width

Word-wrap:break-word; Overflow:hidden;

Ie6 png

Ie6

_background:none;

_filter:progid:dximagetransform.microsoft.alphaimageloader (src= ' images/liuyan_07.png ', sizingMethod= ' crop ');

Crop: Cuts the picture to fit the object's size.

Image: Default value. Increase or decrease the size boundaries of an object to fit the dimensions of the picture.

Scale: Scales the picture to fit the object's dimension boundaries.

Single line out of width ellipsis display

Overflow:hidden;text-overflow:ellipsis;white-space:nowrap; Word-wrap:normal;
(Word-wrap:break-word is set under IE;

Force-swapping is lost; need to reset: Word-wrap:normal;)

Flash background Transparent

Wmode Transparent

Mouse form Focus Empty

<textarea onfocus= "this.value=" > enter what you want to post ....</textarea>

Firefox text field cannot be fixed size

Ff

Resize:none;

Hand-style

Cursor:pointer; Cursor:default;

Character Spacing

Letter-spacing:1em;

Display:inline-block;

Ie6/7

After modifying the display property of the block element to Inline-block, the older browsers IE6/7 and below are not supported

Display:inline-block;

Zoom:1;

*display:inline;

Opacity:0.3;filter:alpha (opacity:40); not working under IE

Ie6, 7

For haslayout reasons, the simplest way to trigger the Haslayout attribute is to set the zoom:1, and without any side effects.

. Opacity{opacity:0.3;filter:alpha (opacity:40); Zoom:1}

table{border:1px;}

No border under Ie8

Ie8

Ie8 need to set td{border:1px}

position:fixed;top:300px;

Ie6

 _position:absolute;                                      

 _top: Expression (Documentelement.scrolltop + + "px");

body {

 _background-image:url (About:blank);     

&NBSP;_BACKGROUND-ATTACHMENT:FIXED;&NBSP;&NBSP;&NBSP;&NBSP;


A:hover span{
Color: #red;
} is not valid

Ie6

a:hover{
Border:none;
}

A:hover span{
Color: #red;
}
or Background:none;


Parent element's Filter:alpha (OPACITY=50); Absolutely positioned child elements cannot inherit

Ie8

Add Z-index:1 to Parent element


When the parent element has a filter filter gradient background, the child elements inside are completely hidden beyond the box.

Ie6

The old DX engine, are local rendering, over the part is no way to display. Consider using pictures to do this stuff.

!important

Ie6

Write separately:

#test {

Text-decoration:underline!important;

}

#test {

Text-decoration:none;

}

Set multiple elements of the

background-attachment: fixed; only the most strata will be effective.

Ie6

The attachment fixed in the most strata under the IE6 function.

No workaround found

Element disappears when an absolutely positioned element is adjacent to a floating element

Ie6

Clear floating

CSS compatibility issues Summary

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.