CSS的IE6、IE7、FF兼容性写法
| 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 */
- color:red; /* 所有浏览器都支持 */
- color:red !important; /* 除IE6外 */
- _color:red; /* IE6支持 */
- *color:red; /* IE6、IE7支持 */
- +color:red; /*IE7支持*/
- *+color:red; /* IE7支持 */
- color:red\9; /* IE6、IE7、IE8、IE9支持 */
- color:red\; /* 针对所有IE */
- color:red\0; /* IE8、IE9支持 */
- color:red\9\0; /*IE9支持*/
- /* webkit and opera */
- @media all and (min-width: 0px){ div{color:red;} }
- /* webkit */
- @media screen and (-webkit-min-device-pixel-ratio:0){ div{color:red;} }
- /* opera */
- @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { div{color:red;} }
- /* firefox * /
- @-moz-document url-prefix(){ div{color:red;} } /* all firefox */
- html>/**/body div, x:-moz-any-link, x:default {color:red;} /* newest firefox */
- body:nth-of-type(1) p{color:red;} /* Chrome、Safari支持 */
- <!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
- <!--[if IE 7 ]> <html class="ie7"> <![endif]-->
- <!--[if IE 8 ]> <html class="ie8"> <![endif]-->
- <!--[if IE 9 ]> <html class="ie9"> <![endif]-->
- <!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
- <!-[if IE 7]> = 等于 IE7
- <!-[if lt IE 8]> = 小于 IE8(就是 IE7 或以下了啦)
- <!-[if gte IE 8]> = 大于或等于 IE8
- <meta http-equiv="x-ua-compatible" content="ie=7" />
- 把这段代码放到<head>里面,在ie8里面的页面解析起来就跟ie7一模一样的了
- <!-[if IE]>
- <link rel="stylesheet" href="/ie-all.css" type="text/css" media="screen" />
- <![endif]->
- <!-[if lt IE 8]>
- <link rel="stylesheet" href="/ie.css" type="text/css" media="screen" />
- <![endif]->
- <!-[if IE 7]>
- <link rel="stylesheet" href="/ie7.css" type="text/css" media="screen" />
- <![endif]->
- <!-[if IE 6]>
- <link rel="stylesheet" href="/ie6.css" type="text/css" media="screen" />
- <![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兼容性写法的更多相关文章
- CSS- ie6,ie7,ie8 兼容性写法,CSS hack写法
css ie6,ie7,ie8 兼容性写法,CSS hack写法 margin-bottom:40px; /*ff的属性*/margin-bottom:140px\9; /* IE6 ...
- div+css 布局下兼容IE6 IE7 FF常见问题
div+css 布局下兼容IE6 IE7 FF常见问题 收藏 所有浏览器 通用 (市面上主要用到的IE6 IE7 FF)height: 100px; IE6 专用 _height: 100px; IE ...
- CSS 在IE6, IE7 和IE8中的差别////////////////z
CSS 在IE6, IE7 和IE8中的差别 关于浏览器的最离奇的统计结果之一就是Internet Explorer 版本6,7和8共存.截至本文,Internet Explorer各个版本总共占据了 ...
- CSS兼容IE6 IE7 IE8 IE9 Firefox的总结
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- (转)Css样式兼容IE6,IE7,FIREFOX的写法
根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子: 区别IE6与FF: background:orange;*background:blue; 区别I ...
- Css样式兼容IE6,IE7,FIREFOX的写法
根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子: 区别IE6与FF: background:orange;*background:blue; 区别I ...
- css区分ie6,7,ff
IE6能识别*,但不能识别 !important,IE7能识别*,也能识别!important;FF不能识别*,但能识别!important; 可以这样区别FF,IE7,IE6: background ...
- css解决IE6,IE7,firefox兼容性问题
在当前IE6 IE7 FifeFox三分天下的情况下,浏览器兼容性问题成为网页设计者需要考虑的问题. 区别不同浏览器的CSS hack写法: 区别IE6与FF: background:orange;* ...
- DIV+CSS IE6/IE7/IE8/FF兼容问题汇总
1.IE8下兼容问题,这个最好处理,转化成ie7兼容就可以.在头部加如下一段代码,然后只要在IE7下兼容了,IE8下面也就兼容了 <meta http-equiv="x-ua-comp ...
随机推荐
- 【阿里云产品公测】消息队列服务MQS java SDK 机器人应用初体验
[阿里云产品公测]消息队列服务MQS java SDK 机器人应用初体验 作者:阿里云用户啊里新人 初体验 之 测评环境 由于MQS支持外网访问,因此我在本地做了一些简单测试(可能有些业余),之后 ...
- 【原创】一些常用的Vi命令,可帮助脱离鼠标
使用Vi编写代码时,如果想脱离鼠标,需要使用一些命令快捷键,下面罗列了一些常用的并且容易记住的: 1. 命令模式下,移动光标或跳转 0到行首 ^到行首第一个非空字符 $到行尾非空字符 fx向后移动光标 ...
- Java Script基础(三) 函数
一.JavaScript中的函数 在JavaScript中,函数类似于Java中的方法,是执行特定功能的代码块,可以重复调用.JavaScript中的函数分为两种,一种是系统函数,另一种是自定义函数. ...
- spring--事务原理
Spring支持以下7种事务传播行为. 传播行为 XML文件 propagation值 含义 PROPAGATION_REQUIRED REQUIRED 表示当前方法必须在一个具有事务的上下文中运行. ...
- Jquery事件委托之Safari
什么是事件委托 事件委托是Jquery中一种事件绑定的方式,不同于常见的事件绑定方式将事件绑定在目标元素上,而是将事件绑定在父级元素上通过事件冒泡来执行绑定函数. //常见的事件绑定(Jquery) ...
- 【转载】看懂SqlServer查询计划
看懂SqlServer查询计划 阅读目录 开始 SQL Server 查找记录的方法 SQL Server Join 方式 更具体执行过程 索引统计信息:查询计划的选择依据 优化视图查询 推荐阅读-M ...
- Android文字转语音
虽然视觉上的反馈通常是给用户提供信息最快的方式,但这要求用户把注意力设备上.当用户不能查看设备时,则需要一些其他通信的方法.Android提供了强大的文字转语音Text-to-Speech,TTS A ...
- Programmer's Jokes
1. 一天, 下着小雨, 和同事们一起去上班,一位同事差点滑倒,另一位同事笑话说:如果人走路用爬的就不会摔倒了! 遂反问他:能用两行代码搞定的事情为什么要用4行呢? 2. 有趣的公式( Fr ...
- linux中利用iptables+geoip过滤指定IP
1. 前提条件 iptables >= 1.4.5 kernel-devel >= 3.7 2. 安装依赖包 代码如下 复制代码 # yum install gcc gcc-c++ m ...
- php中json_decode返回数组或对象的实例
1.json_decode() json_decode (PHP 5 >= 5.2.0, PECL json >= 1.2.0) json_decode — 对 JSON 格式的字符串进行 ...