一句话搞定透明背景!

 .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透明度设置(兼容性)的更多相关文章

  1. CSS透明度设置支持IE,Chrome,Firefox浏览器

    CSS文件里设置例如以下就可以 filter:alpha(opacity=60); //支持IE opacity:0.6; //支持Chrome.Firefox

  2. CSS 透明度 设置 兼容IE FF

    filter:Alpha(Opacity=80);/*IE*/ -moz-opacity:0.8;/*FF*/ opacity: 0.8;/*所有元素*/ 参数设置说明: Alpha(Opacity= ...

  3. 使用JavaScript设置和改变CSS透明度

    在Firefox, Safari, Chrome和Opera下的CSS透明度#myElement {opacity: .7;}IE下的CSS透明度IE下照旧有别于其他浏览器,并且目前也有三个不同版本的 ...

  4. css怎么样设置透明度?

    css怎么样设置透明度?下面本篇文章就来给大家介绍一下使用css设置透明度的方法.有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助. 在CSS中想要设置透明度,可以使用opacity属性 ...

  5. CSS透明度大汇总

    近年来,CSS不透明算得上是一种相当流行的技术,但在跨浏览器支持上,对于开发者来说,可以说是一件令人头疼的事情.目前还没有一个通用方法,以确保透明度设置可以在目前使用的所有浏览器上有效. 这篇汇总主要 ...

  6. 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 ...

  7. 【总结】CSS透明度大汇总

    近年来,CSS不透明算得上是一种相当流行的技术,但在跨浏览器支持上,对于开发者来说,可以说是一件令人头疼的事情.目前还没有一个通用方法,以确保透明度设置可以在目前使用的所有浏览器上有效. 这篇汇总主要 ...

  8. 前端学习笔记之CSS属性设置

    CSS属性设置   阅读目录 一 字体属性 二 文本属性 三 背景属性 四 盒子模型 五 盒子模型各部分详解 一 字体属性 1.font-weight:文字粗细 取值 描述 normal 默认值,标准 ...

  9. [CSS属性设置,盒子模型,网页布局]

    [CSS属性设置,盒子模型,网页布局] CSS属性设置 1. 宽和高 width:属性可以为元素设置宽度. height:属性可以为元素设置高度. 块级标签的宽度不修改的情况下默认占浏览器的一整行,块 ...

随机推荐

  1. web安全问题-cookie

    web安全问题 cookie 1.cookies只能设置过期 不能删除 <script> now.toGMTString() => 事件可以用来设置cookie document.c ...

  2. CompressFormat压缩性能

    在产品应用场景内有个需求,Bitmap原图压缩保存.但是每次保存一个图片,需要500+ms.原本以为是sd卡写的慢.后来测试发现是图片压缩问题.试验过CompressFormat PNG和JPEG两种 ...

  3. P1592 互质

    题意:输入两个正整数n和k,求与n互质的第k个正整数. $n≤10^6,k≤10^8$ 可以枚举出互质的数,居然发现,有循环节.... 比如10 与其互质的1  3  7  9  11  13  17 ...

  4. stl仿函数和适配器

    所谓的适配器就是底层利用仿函数,然后修改仿函数的接口,达到自己的目的: 例如:template<class operation> class binder1st的适配器,其本质是一个类,它 ...

  5. Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier解决办法

    使用Storyboard时出现以下警告: warning: Unsupported Configuration: Scene is unreachable due to lack of entry p ...

  6. 黑马学习连接池 druid JdbcTemplate c3p0 池技术

    package cn.itcast.jdbctemplate; import org.junit.Test; import org.springframework.jdbc.core.BeanProp ...

  7. vue.js 基础

      vuejs 遍历 数组, vue js 文章 http://www.cnblogs.com/libin-1/p/6851775.html https://zhuanlan.zhihu.com/p/ ...

  8. 19. Remove Nth Node From End of List(C++,Python)

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  9. uva 442

    #include<iostream>#include<stack>#include<map>using namespace std;struct node{ int ...

  10. java——Class、动态加载

    Class和Object混淆了? Object: 任何类都是Object类的子类 Class: 任何类都是Class的实例对象 Class可以说是一种特殊的类,它表示的是类类型,Object仍然是Cl ...