ie8 hack

1.‘\9’:css

    eg:.test { color/*\**/: blue\9 }
.header {width:300px;} /* 全部瀏覽器*/
.header {width/*\**/:330px\9;} /* 全部瀏覽器IE瀏覽器 */
.header {*width:310px;} /* IE7和IE6能識別,IE8和FF不能識別*/
.header {_width:290px;} /* IE6能識別,IE七、IE8和FF不能識別*/瀏覽器

 

2.利用條件註釋語句:<!–[if IE]> 此內容只有IE可見 <![endif]–>         less

                lt 表示less than 當前條件版本如下的版本,不包含當前版本。yii

                gte 表示greeter than or equal 當前版本以上版本,幷包含當前版本。ui

                lte 表示less than or equal 當前版本如下版本,幷包含當前版本。blog

 

3.其它hack 技術:get

.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」和「/*\**/」之間有個空格*/it

4.table

彙總下IE各版本的css hack。test

 

 

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

相關文章
相關標籤/搜索