【问题标题】:css opacity in IEIE中的css不透明度
【发布时间】:2010-07-16 13:04:12
【问题描述】:

如何在平滑导航菜单中设置不透明度或过滤器,以便在 IE 的子菜单背景中透明化?

当我将 ddsmoothmenu.css 设置为时

.ddsmoothmenu ul li
{
    position: relative;
    display: inline;
    float: left;
    background: #0a449e;
    opacity: 0.9;
    filter :alpha(opacity=90);
    zoom: 1;
}

它在 chrome 和 FF 中表现不佳,但子菜单未在 IE 中显示。为什么?请给出解决方案,如果有人知道............

【问题讨论】:

  • 如果您还不知道这一点,doctype.com 专门用于解决与 Web 开发相关的问题。你会从那里的专家那里得到更好的答案。
  • 如果删除不透明度的引用,子菜单是否会显示在 IE 中?

标签: css opacity


【解决方案1】:

我发现 filter: alpha(opacity=n) 在 IE 中给出了混合的结果。当它不起作用时,我将在仅 IE 的样式表中使用以下内容来获得相同的效果:

仅适用于 IE 的 CSS:

.ddsmoothmenu ul li {
    background: none;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='trans-bg.png',sizingMethod='scale');

} 

在上面,trans-bg.png 是一个透明的 .png,相当于不透明度为 90% 的颜色 #0a449e。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-06-22
    • 1970-01-01
    • 1970-01-01
    • 2011-04-01
    • 2011-03-21
    • 1970-01-01
    • 2011-03-28
    • 2010-12-12
    相关资源
    最近更新 更多