`

IE8 hack 集

阅读更多

最近察觉到在FF中显示正常的页面,在ie8中并不一定正常,所以有关处理ie8的hack 技术也出现了。

解决方法:

 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.利用条件注释语句:<!–[if IE]> 此内容只有IE可见 <![endif]–>         

                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”和“/*\**/”之间有个空格*/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics