Hack processing for IE 6/7/8

Source: Internet
Author: User
1. IE6 IE7 does not support display: inline-block solution:
After setting display: inline-block, Set * display: inline, * ZOOM: 1
2. Font-size: 100%:
When body {font-sizez; 12px ;}
H1 ~ H6 does not inherit this attribute. You Need To Set Font-size: 100% for it;
Line-Height: it is best to use the plural number. When using the singular number, the display of the browser is different (different browsers parse different)
3. Style truncation, still using ellipsis (only for a single line of text ):
width:***;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
overflow:hidden;
4. Solutions for incompatible max-width and Min-width: in IE6:

_ Width: expression(document.doc umentelement. clientwidth | document. Body. clientwidth)> 1000? 1000 :"")

IE6 supports the minimum width to solve the CSS code:
. Yangshi {Min-width: 1000px; _ width: expression((document.doc umentelement. clientwidth | document. Body. clientwidth)> 1000? "1000px ":"");}

Note: Min-width: 1000px; this is the maximum width supported by IE6 with other brands. And _ width: expression(document.doc umentelement. clientwidth | document. Body. clientwidth)> 1000? "1000px": ""); this means that IE6 supports Min-width to replace CSS code, but the effect is the same as that of other browsers.

Make all browsers support the Min-width CSS style code, complete:
Min-width: 1000px; _ width: expression(document.doc umentelement. clientwidth | document. Body. clientwidth)> 1000? "1000px ":"");
Here, 1000 and 1000px are the values you need. Note that the three values are the same.

For IE6, you can set the minimum width and the maximum width. In this case, we often encounter image control, so that images of uncertain size are too wide to be out of a certain range. When we are small, we do not control his method and use CSS code:

_ Width: expression (this. scrollwidth> 620? "620px": (this. scrollwidth <1? "1px": "Auto "));

One sentence ::

_ Width: expression (this. offsetwidth> 630? '630px ': True );

5. CSS naming rules:

We do not recommend that you use the '--' symbol because IE6 does not recognize it sometimes.

6. Differences between IE6 and IE7 Firefox
IE6 recognition * and --
IE7 recognition * and! Important
Firefox identification! Important cannot recognize *
ie8 * \9

7. IE6 does not support fixed solutions:

  1. Position: fixed;
  2. _ Position: absolute;
  3. Right: 0;
  4. _ Right:-1px;
  5. Top: 80px;
  6. _ Bottom: auto;
  7. Z-index: 2147483647;
  8. _ Top: expression(eval(document.doc umentelement. scrolltop + 80 ));
  9. _ Top: expression(eval(document.doc umentelement. scrolltop | document. Body. scrolltop) inclueval(document.doc umentelement. clientheight | document. Body. clientheight)-520 + 'px ');
8. Transparent rgba in ie9 (ie9 person filter)
Filter: none;/* filter effect in IE 9 browser */background-color: rgba (0.8, 0 );
 

Hack processing for IE 6/7/8

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.