css - 你如何在 IE6 中使 <div> 小于 13px?

标签 css internet-explorer-6

如何在 IE6 中使 DIV 非常短?无论我使用 0.3em 还是 3px,IE6 都会强制最小为 13px。

IE6

IE6

Firefox 3.6.13(在所有其他现代浏览器中看起来非常相似)

FF

HTML

<div id="fileProgressBar" style="display:none">
    <div id="fileProgressFill"></div>
</div>

CSS

#fileProgressBar {
    height: 0.3em;
    background: #444;
    background: -moz-linear-gradient(
        top,
        #333,
        #666
    );
    background: -webkit-gradient(
        linear,
        left top,
        left bottom,
        color-stop(0, #333),
        color-stop(1, #666)
    );
    border-top: 1px solid #000;
}

    #fileProgressFill {
        height: 100%;
        width: 0;
        background: #0088cc;
        background: -moz-linear-gradient(
            top,
            #0099e5,
            #006699
        );
        background: -webkit-gradient(
            linear,
            left top,
            left bottom,
            color-stop(0, #0099e5),
            color-stop(1, #006699)
        );
    }

Javascript

Javascript 在适当的时候显示文件进度条,并在电影播放时更新文件进度填充。但是这个bug不是JS问题,所以我就不贴JS代码了。

最佳答案

原来我把这个复杂化了一点:

只是做:

#fileProgressBar {
    height: 3px;
    font-size: 0;
    ..
}

要在 IE6 中修复它,请在 #fileProgressBar 中添加 font-size: 3px。然而,这使得它在普通浏览器中看起来是错误的。因此,最简单的解决方法是在 conditional comment 中应用该样式。 ,或者像这样添加它,使用 CSS hack (幸运的是确实验证了)所以只有 IE6 可以看到它:

* html #fileProgressBar {
    font-size: 3px
}

我会看看是否有更简洁的方法来解决这个问题。

关于css - 你如何在 IE6 中使 <div> 小于 13px?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4799419/

相关文章:

javascript - 具有全宽下拉面板的流体 CSS 产品网格(无绝对定位)

html - 在 IE7 中链接不可点击

html - 忽略父表列限制的表中表

html - CSS:使嵌套的最小高度一致

html - 删除表格之间的间距

jquery - 下拉菜单在 IE6 中不起作用

html - IE6无法加载页面

CSS回归工具?

html - 我的导航菜单不适用于 IE < 9

caching - IE6 和缓存