欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

 

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IE的if条件css hack实例</title>
<style type="text/css">
<!--[if IE]>
<!--
.ys1 {color: #FF0000}
-->
<![endif]-->
</style>
</head>

<body>
<p>&lt;!--[if&nbsp;IE]&gt;&nbsp;Only&nbsp;IE&nbsp;&lt;![endif]--&gt;</p>
<p>我是<span class="ys1">css5.com.cn</span>测试花色
</p>
</body>
</html>


 

 

 

截图如下

左边为微软IE涉猎器,右侧为火狐阅读器,通过if前提对样式设置只在ie中起作用后成效图。
额定说白的if前提在ie8中不克不及收效。

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/jiqiao/j53582.shtml