CSS-透明度设置

css 复制代码
.transparent_class {
      filter:alpha(opacity=50);
      -moz-opacity:0.5;
      -khtml-opacity: 0.5;
      opacity: 0.5;
}

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 .
相关推荐
Bigger9 分钟前
🎨 用一次就爱上的图标定制体验:CustomIcons 实战
前端·react.js·icon
谢尔登18 分钟前
原来Webpack在大厂中这样进行性能优化!
前端·webpack·性能优化
cypking2 小时前
Vue 3 + Vite + Router + Pinia + Element Plus + Monorepo + qiankun 构建企业级中后台前端框架
前端·javascript·vue.js
雨雨雨雨雨别下啦2 小时前
【从0开始学前端】vue3简介、核心代码、生命周期
前端·vue.js·vue
simon_93493 小时前
受够了压缩和收费?我作为一个码农,手撸了一款无限容量、原图直出的瀑布流相册!
前端
e***87703 小时前
windows配置永久路由
android·前端·后端
Dorcas_FE4 小时前
【tips】动态el-form-item中校验的注意点
前端·javascript·vue.js
小小前端要继续努力4 小时前
前端新人怎么更快的融入工作
前端
四岁爱上了她4 小时前
input输入框焦点的获取和隐藏div,一个自定义的下拉选择
前端·javascript·vue.js
fouryears_234174 小时前
现代 Android 后台应用读取剪贴板最佳实践
android·前端·flutter·dart