不透明!重要的不工作 [英] Opacity !important doesn't work

查看:102
本文介绍了不透明!重要的不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

<tr style="opacity: 0.5;"><td><img style="opacity: 1.0 !important;" src="/img/crap.png"/><div>Some text, etc...</td></tr>

我不希望图像以完全不透明度显示,休息应该只有50% ,我也尝试过!important 属性,但它不工作。我也试图将这些样式移动到css文件中的类。图片总是有50%的不透明度。

I wan't the image to be showed with full opacity, and rest should be only 50% opacity, I've tried also with !important attribute, but it doesn't work. I've tried also to move that styles to the class in the css file. Image always has 50% of opacity.

如何解决这个问题?

推荐答案

此问题与您的问题相同。

There's an existing question about the same problem with yours.

链接来到这里:将div的背景设置为透明而不是边框​​

property with color and opacity:

The strategy is using CSS "background" properties with color and opacity:

background-color: rgba(0,255,255,0.4)

有关rgba的好文章可以在这里找到: CSS RGBA

A good article about rgba can be found here : CSS RGBA

希望有这个帮助。 :)

Hope this help. :)

这篇关于不透明!重要的不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆