css 不透明度
CSS provides an excellent means of adding opacity to any element with the opacity
property. Opacity values must be anywhere from 0 (not visible) and 1 (completely visible). Adding opacity to an element used to be quite a chore -- lots of browser-specific CSS was required:
CSS提供了一种极好的方法,可以通过opacity
属性为任何元素添加不opacity
。 不透明度值必须介于0(不可见)和1(完全可见)之间。 向元素添加不透明度过去非常繁琐-需要大量特定于浏览器CSS:
.opacityElement { /* 50% opacity */
-webkit-opacity: 0.5;
-moz-opacity: 0.5;
filter:alpha(opacity=50);
}
Modern browsers have implemented a very basic CSS opacity
property so the browser-specific code is no longer needed:
现代浏览器已实现了非常基本CSS opacity
属性,因此不再需要特定于浏览器的代码:
.opacityElement { /* 50% opacity */
opacity: 0.5;
}
CSS opacity is great in showing and deminishing focus, and paired with CSS animations and transforms, can be eleganty displayed. Opacity is supported by all major web browsers and can be used today!
CSS不透明度非常适合显示和消除焦点,并且可以与CSS动画和变换配合使用,从而优雅地显示。 所有主要的网络浏览器都支持Opacity,并且今天就可以使用它!
css 不透明度