Heim  >  Artikel  >  Web-Frontend  >  ie8 hack_html/css_WEB-ITnose

ie8 hack_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:33:001072Durchsuche

1.‘\9’:

    eg:.test { color/*\**/: blue\9 }
.header {width:300px;} /* 所有浏览器*/
.header {width/*\**/:330px\9;} /* 所有浏览器IE浏览器 */
.header {*width:310px;} /* IE7和IE6能识别,IE8和FF不能识别*/
.header {_width:290px;} /* IE6能识别,IE7、IE8和FF不能识别*/

 

2.利用条件注释语句: 此内容只有IE可见          

                lt 表示less than 当前条件版本以下的版本,不包含当前版本。

                gte 表示greeter than or equal 当前版本以上版本,并包含当前版本。

                lte 表示less than or equal 当前版本以下版本,并包含当前版本。

 

3.其它hack 技术:

.color1{ color:#F00; color/*\**/:#00F /*\**/}/*IE6,IE7,IE8,FF,OP,SA识别*/
.color2{ color:#F00; color /*\**/:#00F /*\9**/}/*IE7,IE8,FF,OP,SA识别*/
.color3{ color:#F00; color/*\**/:#00F \9}/*IE6,IE7,IE8识别*/
.color4{ color:#F00; color /*\**/:#00F\9}/*IE7,IE8识别*//*“color”和“/*\**/”之间有个空格*/

4.

汇总下IE各版本的css hack。

 

 

hack 示例 IE6(S) IE6(Q) IE7(S) IE7(Q) IE8(S) IE8(Q)
* *color Yes Yes Yes Yes No Yes
+ +color Yes Yes Yes Yes No Yes
- -color Yes Yes No No No No
_ _color Yes Yes No Yes No Yes
# #color Yes Yes Yes Yes No Yes
\0 color\0 No No No No Yes No
\9 color\9 Yes Yes Yes Yes Yes Yes
!important color:blue !important;
color:green;
No No Yes No Yes No

 

标准模式中:

1,减号(-)是IE6专有hack

2,反斜杠零(\0)是IE8专有hack

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn