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 .
相关推荐
软弹7 分钟前
深入理解 React Ref 机制:useRef 与 forwardRef 的协作原理
前端·javascript·react.js
YaHuiLiang11 分钟前
Ai Coding浪潮下的前端:“AI在左,裁员在右”
前端
雪碧聊技术19 分钟前
前端vue代码架子搭建
前端·javascript·vue.js·前端项目代码框架搭建
爱学习的程序媛19 分钟前
【Web前端】前端用户体验优化全攻略
前端·ui·交互·web·ux·用户体验
han_22 分钟前
JavaScript设计模式(二):策略模式实现与应用
前端·javascript·设计模式
x***r15126 分钟前
Notepad++ 8.6 安装教程:详细步骤+自定义安装路径(附注意事项)
linux·前端·javascript
Hilaku29 分钟前
为什么很多工作 5 年的前端,身价反而卡住了?🤷‍♂️
前端·javascript·面试
ai超级个体29 分钟前
前端下午茶:这 3 个网页特效建议收藏(送源码)
前端·three.js·threejs·网页设计·vibe coding·网页灵感·网页分享
维斯1829 分钟前
VueFlow 图自适应容器尺寸教程
前端
helloweilei30 分钟前
next/dynamic和React.lazy的区别
前端·next.js