css 不透明度_CSS不透明度

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,并且今天就可以使用它!

翻译自: https://davidwalsh.name/css-opacity

css 不透明度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值