【问题标题】:IE PNG fix problemIE PNG修复问题
【发布时间】:2009-09-08 14:23:07
【问题描述】:

我从这里申请了 ie PNG:http://www.twinhelix.com/css/iepngfix/

所以我可以在我的 CSS 中使用透明的 PNG 背景图像。它适用于 div,但问题是当我为无序列表 (ul) 提供透明背景时,它不起作用。

这里是标记:

<div id="footer">
    <ul>
        <li><a href="#">Link 1</a></li>
        <li><a href="#">Link 2</a></li>
        <li><a href="#">Link 3</a></li>
    </ul>
    <p>&copy; 2009 Your Name</p>
</div>

以下是样式表的相关部分:

/* IE PNG fix */
img, div, ul { behavior: url('/css/iepngfix/iepngfix.htc') }

#footer {
    width: 876px;
    margin: 0 auto;
    background: none;
    text-align: center;
    line-height: 1.5em;
    font-size: .8em;
}
#footer ul {
    padding: 40px 0 13px;
    background: url('wrapper-bottom.png') center top no-repeat;
}
#footer p {
    padding-bottom: 15px;
}

我也尝试添加背景:透明;到#footer div,但没有成功。应用于 div 的其他 PNG 图像可以工作,但在 wrapper-bottom.png 下有一个灰色背景(#333),这是大多数网站内容区域的背景,但我特别声明了 background: none;对于#footer,所以应该没有:(

编辑:实际上,当我没有为#footer div 指定高度时,整个页脚都有灰色背景...

编辑:实际上,在我发布此消息几分钟后,我自己设法解决了这个问题。不过,我使用了一个非常丑陋的 hack:

#footer {
    height: 0;
}
#footer ul {
    height: 30px;
}

这似乎适用于所有 IE 版本。

【问题讨论】:

  • 我刚刚设法解决了这个问题 :) 请参阅编辑

标签: html css internet-explorer


【解决方案1】:

尝试使用 Unitpng Fix。

它很容易实现,也可以与背景 png 一起使用...

Check out this link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-28
    • 1970-01-01
    • 2012-07-27
    • 2023-03-29
    • 2011-01-01
    • 2013-02-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多