css hack有三种分别为:
1.IE条件注释法
<!--[if IE]> //表示只在IE下生效
<link type="text/CSS" href="test.css" rel="stylesheet"/>
<! [endif]-->
<!--[if IE 6]> //表示只在IE6下生效
<link type="text/CSS" href="test.css" rel="stylesheet"/>
<! [endif]-->
<!--[if gt IE 6]> //表示只在IE6以上版本下生效
<link type="text/CSS" href="test.css" rel="stylesheet"/>
<! [endif]-->
<!--[if ! IE 7]> //表示只在IE7下不生效
<link type="text/CSS" href="test.css" rel="stylesheet"/>
<! [endif]-->
<!--[if IE 6]> //条件注释style标签
<style type="test/CSS">
.test{}
</style>
<! [endif]-->
<!--[if IE 6]> //条件注释script标签
<script type="text/JavaScript">
alert("1111")
</script>
<! [endif]-->
lte小于等于,lt小于,gte大于等于,gt大于,!不等于
2.选择符前缀法
<style type="test/CSS">
.test{width:100px;}
*html .test{width:150px;} //只适用于IE6
*+html .test{width:50px;} //只是用于IE7
</style>
*表示只是只对IE6生效,*+表示只对IE7生效
3.样式属性前缀法
<style type="test/CSS">
.test{width:90px;*width:70px;_width:35px;}
</style>
_只在IE6下生效,*在IE67下生效