CSS 增加+100% 图像不透明度,可能吗?
我尝试使用文本,仅使用:opacity:3;filter:alpha(opacity=300);
,它可以工作,但不能使用 >图像,
还有其他选择吗?
I tried with text just with: opacity:3;filter:alpha(opacity=300);
and it works, but not with images,
any alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您尝试使图像变暗,则无法使用高于 100% 的不透明度来实现此目的。 100% 不透明度是最明显的,不透明度比例(如照片/视频编辑中)从 0(完全透明)到 100(完全不透明度)。
但是,您可以为图像指定一个过滤器属性,该属性将覆盖在图像顶部。该滤镜属性可以做很多事情,但在这种情况下,您将从滤镜属性的亮度设置中受益最多。 100% 亮度将以原始形式显示图像,而亮度百分比越低,滤镜变得越暗,因此图像也越暗。
它看起来像这样:
If you are trying to make the images darker you cannot do that with opacity higher than 100%. 100% opacity is the most visible, the opacity scale (like in photo/video editing) is from 0 (completely transparent) to 100 (full opacity).
You can however give your image a filter property which will overlay on top of the image. That filter property can do a lot but in this case you would benefit most from the brightness setting of the filter property. 100% brightness will show your image in it's original form, whereas the lower the percent of the brightness the darker the filter will get and thus the darker your image.
It would look something like this:
即使可以将不透明度值设置为高于 100%,这样做也没有任何好处。一旦某物达到 100% 不透明,它就不会明显变得比这更不透明了。
您想通过将不透明度设置为 100% 以上来实现什么目的?可能还有一些其他属性可以给您带来所需的效果。
Even it it's possible to set opacity values above 100%, there is no benefit to doing so. Once something is 100% opaque it cannot visibly become any more opaque than that.
What is it that you are trying to accomplish by setting the opacity above 100%? There may be some other property that will give you the desired effect.
图像透明度
我认为 opacity=300 没有任何意义;尝试不透明度=30?
同样,当您说 opacity=3 时,您应该尝试 opacity=0.3
Image Transparency
I don't think opacity=300 makes any sense; try opacity=30?
Likewise where you are saying opacity=3, you should try opacity=0.3