html - IE PNG修复问题

标签 html css internet-explorer

我已经从这里应用了 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),这是大多数网站内容区域的背景,但我特别声明背景:无;对于#footer,所以应该没有:(

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

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

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

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

最佳答案

尝试使用 Unitpng Fix。

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

Check out this link

关于html - IE PNG修复问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1394316/

相关文章:

css - hr 使父 div 在 IE7 中调整为 100%

css - 用于在 css 文件中查找重复的十六进制值的正则表达式

css - 您如何处理 SMACSS 中模块的布局特定更改?

html - 背景图像不显示完整图像

css - background-url 属性在不同浏览器中的不同行为

html - 从没有页脚的网站中删除单杠

html - 使用 Bootstrap 在警报中定位按钮

php - 如何将元素(下拉菜单项)定位在父菜单的正下方

jquery 焦点在 IE 中不起作用

javascript - Internet Explorer(奇怪)的行为