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

IE的CSS if条件Hack- css hack 
通过CSS5为各人说明注解DIV+CSS中if前提hack知识与教程实例

目录
  1. Css if hack前提语法
  2. DIV+CSS if实例
  3. if前提hack总结

1、Css if hack前提语法

<!--[if IE]> Only IE <![endif]-->
仅全数的WIN琐细自带IE可识别
<!--[if IE 5.0]> Only IE 5.0 <![endif]-->
只要IE5.0大约识别
<!--[if gt IE 5.0]> Only IE 5.0+ <![endif]-->
IE5.0包换IE5.5均或者识别
<!--[if lt IE 6]> Only IE 6- <![endif]-->
仅IE6可识别
<!--[if gte IE 6]> Only IE 6/+ <![endif]-->
IE6以及IE6以下的IE5.x都可识别

<!--[if lte IE 7]> Only IE 7/- <![endif]-->
仅IE7可辨认
<!--[if gte IE 7]> Only IE 7/+ <![endif]-->
IE7以及IE7以下的IE6、IE5.x均可识别

<!--[if IE 8]> Only IE 8/- <![endif]-->
仅IE8可识别

2、DIV+CSS实例教程

CSS实例一:
让IE6-IE8浮现不合的模式,DIV CSS代码下列:

 

 <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DIV IF前提实例WWW.CSS5.COM实例</title>
</head>
<body>
你正在使用:
<!--[if IE 7]> 
<h2>IE7</h2>
<![endif]-->
<!--[if IE 6]> 
<h2>IE6</h2>
<![endif]-->
<!--[if IE 8]> 
<h2>IE8</h2>
<![endif]-->
<br><br>
<strong>CSS5说明</strong>:假设你的涉猎器版本为若干好多即会展示IE几何,针对IE6-IE8实行CSS教程 
</body>
</html>
 

 

 

阐明:以上针对不合IE透露表现差距网页内容DIV+CSS实例试验。

DIV+CSS实例二:
让IE6-IE8显示差别CSS名堂成果,DIV CSS代码下列:

 

 <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS IF条件hack实例 css5.com.cn</title>
<!--[if IE 6]> 
<style type="text/css">
.CSS5{ color:#F00;}
</style>
<![endif]-->
<!--[if IE 7]> 
<style type="text/css">
.CSS5{ color:#FF0;}
</style>
<![endif]-->
<!--[if IE 8]> 
<style type="text/css">
.CSS5{ color:#00F;}
</style>
<![endif]-->
</head>
<body>
<div class="CSS5">
DIV CSS实验暗示:<br>
我在IE6下是红色彩,在IE7下是黄色调,在IE8下是蓝色调
</div>
</body>
</html>

 

 

 

注明:以上履行仅试验IE6-IE8下if HACK。

3、div css if前提hack小结

如需更多的衍生重要,人人可经由CSS5小小履行裁减,失去本身需求。以上CSS if条件 HACK实行渴想对你有接济,需求拷贝以上代码自身理论实践以便驾御为我所用只指数。

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