博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

ie6 ie7 ie8 ie9 ff css 区别

Posted on 2012-05-28 15:45  绝交  阅读(1124)  评论(2编辑  收藏  举报

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>css 区别ie6 ie7 ie8 ie9 ff</title>
<style type="text/css">
div{ width:500px; height:300px;  border:1px solid #f00; margin:0px auto;}
.info{
 /* background:#000!important\0 ||  background:#000!important\0\9 ie6识别  ff ie7 ie8 ie9 不识别*/
 /*background:#000!important   ie6 ff ie7 ie8 ie9 识别 */
 /*background:#000;  ie6 ff ie7 ie8 ie9 识别 */
 /*background:#000\0;  ie6 ff ie7 不识别 ie8 ie9 识别 */
 /*background:#000\9;  ie6 ie7 ie8 ie9 识别 ff不识别 */
 /*background:#000\9;  ie6 ie7 ie8 ie9 识别 ff不识别 */
 /*background:#000\0\9; ie6 ie7 ff 不识别 ie8 ie9 识别*/
 /* *background:#000; ie6 ie7识别 ie8 ie9 ff 不识别*/
 /* *_background:#000; _background:#000; ie6 识别ie7 ie8 ie9 ff 不识别*/
background:#FF0; /* ff */ /*黄色*/
background:#0F0\9;/* ie 8 ie 9*//*绿色*/  
*background:#F00;/*ie 6 ie 7*/ /* 红色*/
_background:#00F; /*ie 6*/ /*蓝色*/
}
</style>
<!--[if IE 8]>
<style type="text/css">
.info{
background:#000;
}
</style>
<![endif]-->
</head>
<body>
<div class="info">
可以用 \0 \9 来表示ie8 和ie9<br>
可以用 * 区别 IE7<br>
可以用 _ 区别 ie6<br>
但最后无法 区别IE8 ie9<br>
所以值能用<!--[if IE 8]> ie8 样式<![endif]-->
一定要放在最后
如果各位有更好的办法或哪里写的有误,请在评论中注明
</div>
</body>
</html>