IE8 CSS hack

2020-05-10 11:31:24易采站长站整理

IE条件注释还支持感叹号非操作:
程序代码
<!–[if !IE 6.0]>此内容除了IE6.0版本之外都可见<![endif]–>
并且支持前缀,用于判断更高版本或是更低版本:
程序代码
<!–[if gt IE 5.0]>此内容只有IE5.0以上版本可见<![endif]–>
这里的gt全称为greater than表示当前条件版本以上版本,但不包含当前版本。
还有其它几个前缀:
lt 表示less than 当前条件版本以下的版本,不包含当前版本。
gte 表示greeter than or equal 当前版本以上版本,并包含当前版本。
lte 表示less than or equal 当前版本以下版本,并包含当前版本。

其他一些css hack的测试:

1.
.color
1
{ 
color
:
#F00
; color
/***/
:
#00F
/***/
}
/*IE6,IE7,IE8,FF,OP,SA识别*/

2.
.color
2
{ 
color
:
#F00
; color 
/***/
:
#00F
/*9**/
}
/*IE7,IE8,FF,OP,SA识别*/

3.
.color
3
{ 
color
:
#F00
; color
/***/
:
#00F
9
}
/*IE6,IE7,IE8识别*/