CSS透明度设置(兼容性)
一句话搞定透明背景!
.transparent_class {
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
UPDATE: I wanted to pull this post out of the archives and update it a bit because it there seems to be a good amount of interest in this subject.
Here is what each of those CSS properties is for:
- opacity: 0.5; This is the “most important” one because it is the current standard in CSS. This will work in most versions of Firefox, Safari, and Opera. This would be all you need if all browsers supported current standards. Which, of course, they don’t.
- filter:alpha(opacity=50); This one you need for IE.
- -moz-opacity:0.5; You need this one to support way old school versions of the Mozilla browsers like Netscape Navigator.
- -khtml-opacity: 0.5; This is for way old versions of Safari (1.x) when the rendering engine it was using was still referred to as KTHML, as opposed to the current WebKit .
PS:本文章转自http://www.cnblogs.com/luluping/archive/2010/10/12/1848360.html,感谢原作者分享
CSS透明度设置(兼容性)的更多相关文章
- CSS透明度设置支持IE,Chrome,Firefox浏览器
CSS文件里设置例如以下就可以 filter:alpha(opacity=60); //支持IE opacity:0.6; //支持Chrome.Firefox
- CSS 透明度 设置 兼容IE FF
filter:Alpha(Opacity=80);/*IE*/ -moz-opacity:0.8;/*FF*/ opacity: 0.8;/*所有元素*/ 参数设置说明: Alpha(Opacity= ...
- 使用JavaScript设置和改变CSS透明度
在Firefox, Safari, Chrome和Opera下的CSS透明度#myElement {opacity: .7;}IE下的CSS透明度IE下照旧有别于其他浏览器,并且目前也有三个不同版本的 ...
- css怎么样设置透明度?
css怎么样设置透明度?下面本篇文章就来给大家介绍一下使用css设置透明度的方法.有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助. 在CSS中想要设置透明度,可以使用opacity属性 ...
- CSS透明度大汇总
近年来,CSS不透明算得上是一种相当流行的技术,但在跨浏览器支持上,对于开发者来说,可以说是一件令人头疼的事情.目前还没有一个通用方法,以确保透明度设置可以在目前使用的所有浏览器上有效. 这篇汇总主要 ...
- css不同浏览器兼容性调试 --- 转自: [http://wo.115.com/?ct=detail&id=31733&bid=1018841]
css不同浏览器兼容性调试 IE6.0,IE7.0与Firefox的CSS兼容性问题1.DOCTYPE 影响 CSS 处理 2.FF: div 设置 margin-left, margin-right ...
- 【总结】CSS透明度大汇总
近年来,CSS不透明算得上是一种相当流行的技术,但在跨浏览器支持上,对于开发者来说,可以说是一件令人头疼的事情.目前还没有一个通用方法,以确保透明度设置可以在目前使用的所有浏览器上有效. 这篇汇总主要 ...
- 前端学习笔记之CSS属性设置
CSS属性设置 阅读目录 一 字体属性 二 文本属性 三 背景属性 四 盒子模型 五 盒子模型各部分详解 一 字体属性 1.font-weight:文字粗细 取值 描述 normal 默认值,标准 ...
- [CSS属性设置,盒子模型,网页布局]
[CSS属性设置,盒子模型,网页布局] CSS属性设置 1. 宽和高 width:属性可以为元素设置宽度. height:属性可以为元素设置高度. 块级标签的宽度不修改的情况下默认占浏览器的一整行,块 ...
随机推荐
- CoreData 数据库
封装CoreManager类 @implementation CoreDataManager { //上下文 NSManagedObjectContext *_ctx; } //单例 +(instan ...
- 封装下Excel导出
1. 使用方法 1.1 对象使用注解 @ExcelColumn(name = "页面1",freeze = "0,1,1,2",autoWidth=true) ...
- 【STL基础】list
list 构造函数: //default: list<T> l; //空的list //fill: list<T> l(n); //n个元素, 元素默认初始化 list< ...
- composer.json 配置设置
配置文件的值为 key:val 必须双引号包裹 一.配置文件 名字 name包名称由用户名名称和仓库名称组成包版本限制来请求Monolog软件包 1.0.*.这意味着1.0开发分支中的任何版本,或大于 ...
- vmware正在使用中问题
解决方法:找到vmware目录下的.lck文件,将其删掉即可.
- 读经典——《CLR via C#》(Jeffrey Richter著) 笔记_引用类型和值类型(二)
[引用类型和值类型的区别] //引用类型(由于使用了‘class’) class SomeRef { public Int32 x; } //值类型(由于使用了‘struct’) struct Som ...
- Codeforces Round #340 (Div. 2) C
Description A flowerbed has many flowers and two fountains. You can adjust the water pressure and se ...
- navicat data modeler的使用以及数据库设计的流程
E-R图(Entity Relationship Diagram) 又称实体-联系图 (提供了表示实体类型.属性和联系的方法,用来描述现实世界的概念模型) 构成E-R图的3个基本要素是实体型.属性和联 ...
- Java中Array与ArrayList的主要区别
1)精辟阐述: 可以将 ArrayList想象成一种"会自动扩增容量的Array". 2)Array([]):最高效:但是其容量固定且无法动态改变: ArrayList: ...
- 函数之-------------------------HR管理操作
import os import time def emplog(content): #记录操作的一个函数,在删除,添加,修改都会用到这一操作, f=open("emp.log", ...