不透明度不适用于超链接指向的 img

发布于 2024-09-17 04:54:36 字数 260 浏览 9 评论 0原文

在 asp.net 应用程序中,我使用指向图像的超链接。在某些条件下我设置它 IE 的“过滤器”属性为 alpha(opacity=70) Firefox 的“不透明度”设置为 0.7 使得描绘禁用模式时显得迟钝。这在 FIREFOX 中工作正常,即在禁用模式下显示迟钝,但在 IE 中则不然。

我看到过滤器属性是在锚标记上设置的,而不是在锚标记内存在的 img 标记上设置的。如果我明确地将过滤器放在图像上,它就会起作用。但我无法以编程方式做到这一点。

有什么想法吗?

In an asp.net applicaiton I am using Hyperlink which points to an image. On certain condition I am setting its
"filter" property to alpha(opacity=70) for IE
and "opacity" prop to 0.7 for Firefox
so that it is shown dull to depict disable mode. This works fine in FIREFOX ie it shows dull in disabled mode but not in IE.

I see that the filter property is set on anchor tag and not on img tag present inside anchor. If I explicitly put the filter on image it works. But I am not able to do that programatically.

Any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

递刀给你 2024-09-24 04:54:36

如果您还没有,我将为过滤器创建一些开/关 CSS 类,然后根据您的条件动态更改分配的类。然后您可能想尝试将每个链接放入 div 中并将类分配给 div 标签。

If you're not already, I would create some on/off CSS classes for the filter and then dynamically change the class that gets assigned based on your conditions. Then you may want to try putting each link inside a div and assign the classes to the div tags.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文