blue;< /td> Firefox 背景变蓝色
red /9; IE8 背景变红色
*black;< /td> IE7 背景变黑色
_background:orange; IE6 背景变橘色

#example { color: #333; } /* Moz */

* html #example { color: #666; } /*IE6 */

*+html #example { color: #999; } /* IE7 */

  1. color:red; /* 所有浏览器都支持 */
  2. color:red !important; /* 除IE6外 */
  3. _color:red; /* IE6支持 */
  4. *color:red; /* IE6、IE7支持 */
  5. +color:red; /*IE7支持*/
  6. *+color:red; /* IE7支持 */
  7. color:red\9; /* IE6、IE7、IE8、IE9支持 */
  8. color:red\; /* 针对所有IE */
  9. color:red\0; /* IE8、IE9支持 */
  10. color:red\9\0; /*IE9支持*/
  11. /* webkit and opera */
  12. @media all and (min-width: 0px){ div{color:red;} }
  13. /* webkit */
  14. @media screen and (-webkit-min-device-pixel-ratio:0){ div{color:red;} }
  15. /* opera */
  16. @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { div{color:red;} }
  17. /* firefox * /
  18. @-moz-document url-prefix(){ div{color:red;} } /* all firefox */
  19. html>/**/body div, x:-moz-any-link, x:default {color:red;} /* newest firefox */
  20. body:nth-of-type(1) p{color:red;} /* Chrome、Safari支持 */
  21. <!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
  22. <!--[if IE 7 ]> <html class="ie7"> <![endif]-->
  23. <!--[if IE 8 ]> <html class="ie8"> <![endif]-->
  24. <!--[if IE 9 ]> <html class="ie9"> <![endif]-->
  25. <!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
  26. <!-[if IE 7]> = 等于 IE7
  27. <!-[if lt IE 8]> = 小于 IE8(就是 IE7 或以下了啦)
  28. <!-[if gte IE 8]> = 大于或等于 IE8
  29. <meta http-equiv="x-ua-compatible" content="ie=7" />
  30. 把这段代码放到<head>里面,在ie8里面的页面解析起来就跟ie7一模一样的了
  31. <!-[if IE]>
  32. <link rel="stylesheet" href="/ie-all.css" type="text/css" media="screen" />
  33. <![endif]->
  34. <!-[if lt IE 8]>
  35. <link rel="stylesheet" href="/ie.css" type="text/css" media="screen" />
  36. <![endif]->
  37. <!-[if IE 7]>
  38. <link rel="stylesheet" href="/ie7.css" type="text/css" media="screen" />
  39. <![endif]->
  40. <!-[if IE 6]>
  41. <link rel="stylesheet" href="/ie6.css" type="text/css" media="screen" />
  42. <![endif]->

IE6以下

*html{}

IE 7 以下

*:first-child+html {} * html {}

只对IE 7

*:first-child+html {}

只对IE 7 和现代浏览器

html>body {}

只对IE 8(属性值后加/0)

.name {color:#ccc/0; }

只对现代浏览器(非IE 7)

html>/**/body {}

最新的Opera 9以下版本

html:first-child {}

Safari

html[xmlns*=”"] body:last-child {}

Firefox 3

.classname, x:-moz-any-link, x:default {}

#id, x:-moz-any-link, x:default {}

====================

所有浏览器下背景变灰(半透明)

body {filter:alpha(opacity=30);opacity:0.3;}

====================

区别IE6与FF:

background:orange;*blue;< /p>

区别IE6与IE7:

background:green !important;blue;< /p>

区别IE7与FF:

background:orange; *background:green;

区别FF,IE7,IE6:

background:orange;*background:green !important;*blue;< /p>

区别FF 3

“{”前加上“, x:-moz-any-link, x:default”,只有FF 3能识别

注:

IE都能识别*;标准浏览器(如FF)不能识别*;

IE6能识别*,但不能识别 !important,

IE7能识别*,也能识别!important;

只有IE8能识别/0

FF不能识别*,但能识别!important;

CSS的IE6、IE7、FF兼容性写法的更多相关文章

  1. CSS- ie6,ie7,ie8 兼容性写法,CSS hack写法

    css ie6,ie7,ie8 兼容性写法,CSS hack写法 margin-bottom:40px;       /*ff的属性*/margin-bottom:140px\9;    /* IE6 ...

  2. div+css 布局下兼容IE6 IE7 FF常见问题

    div+css 布局下兼容IE6 IE7 FF常见问题 收藏 所有浏览器 通用 (市面上主要用到的IE6 IE7 FF)height: 100px; IE6 专用 _height: 100px; IE ...

  3. CSS 在IE6, IE7 和IE8中的差别////////////////z

    CSS 在IE6, IE7 和IE8中的差别 关于浏览器的最离奇的统计结果之一就是Internet Explorer 版本6,7和8共存.截至本文,Internet Explorer各个版本总共占据了 ...

  4. CSS兼容IE6 IE7 IE8 IE9 Firefox的总结

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. (转)Css样式兼容IE6,IE7,FIREFOX的写法

    根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子: 区别IE6与FF:          background:orange;*background:blue;   区别I ...

  6. Css样式兼容IE6,IE7,FIREFOX的写法

    根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子: 区别IE6与FF:          background:orange;*background:blue;   区别I ...

  7. css区分ie6,7,ff

    IE6能识别*,但不能识别 !important,IE7能识别*,也能识别!important;FF不能识别*,但能识别!important; 可以这样区别FF,IE7,IE6: background ...

  8. css解决IE6,IE7,firefox兼容性问题

    在当前IE6 IE7 FifeFox三分天下的情况下,浏览器兼容性问题成为网页设计者需要考虑的问题. 区别不同浏览器的CSS hack写法: 区别IE6与FF: background:orange;* ...

  9. DIV+CSS IE6/IE7/IE8/FF兼容问题汇总

    1.IE8下兼容问题,这个最好处理,转化成ie7兼容就可以.在头部加如下一段代码,然后只要在IE7下兼容了,IE8下面也就兼容了 <meta http-equiv="x-ua-comp ...

随机推荐

  1. UIView 的transitionFromView方法实现视图切换

    #import "ViewController.h" @interface ViewController () @property (strong, nonatomic) IBOu ...

  2. JD轮播图代码

    <!DOCTYPE html>   <html>   <head>   <title>jd网站的轮播图效果</title>   <me ...

  3. 如何将你自己的Python package发布到PyPI上

    零.前言 最近做了一个小工具,查询IP或者域名的归属地.做完之后想发布到PyPI上,这样大家就可以通过pip来安装了. 在发布的过程中遇到了一些问题,也学到了很多东西.记录到这篇文章中.希望对大家有所 ...

  4. ubuntu下规避终端打开gvim出现的错误

    在终端下面打开gvim会出现下面的错误: GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after cl ...

  5. CentOS服务器的16个监控命令

    你可以通过图形化用户界面(GUI)程序来获取这些外壳命令提供的大量信息,具体取决于使用哪一种Linux发行版.比如说,SUSE Linux就有一款出色的.图形化配置和管理工具YaST,KDE的KDE ...

  6. Nginx服务器不支持PATH_INFO的问题及解决办法

    最近在写一个小程序,然后里面自己写了个URL的处理器,比如说访问index.php/article 那么就会自动加载进来article页面,访问index.php/home就会自动加载home页面. ...

  7. Android处理Bitmap使其能够不失真等比缩放裁剪后显示在ImageView上

    Android开发过程中,我们有时需要动态得显示一些图片,并且这些图片的大小差距会十分大,如果需求并不是需要图片完整显示,但是需要不失真,并且要图片中间部分的情况下,我们需要做一系列处理,因为这个时候 ...

  8. 23----2013.07.01---Div和Span区别,Css常用属性,选择器,使用css的方式,脱离文档流,div+css布局,盒子模型,框架,js基本介绍

    01 复习内容 复习之前的知识点 02演示VS创建元素 03div和span区别 通过display属性进行DIV与Span之间的转换.div->span 设置display:inline   ...

  9. DNS服务器搭建

    注意正式运行的dns服务器主dns设置 中没有启用转发器,所以部分网页如taobao解析时可能很慢.开启转发器即可转发器地址指向电信dns. [root@master ~]# lsb_release ...

  10. UINavigationController与UITabbarController的样式

    之前虽然也手写过这两中视图控制器,但是更多的还是使用SB来创建,最近发现了一些问题,现在总结一下. 1.改变UINavigationBar的颜色 在UINavigationController中,之前 ...