【问题标题】:Liquid images in firefox not liquidFirefox中的液体图像不是液体
【发布时间】:2012-02-25 10:44:09
【问题描述】:

所以我得到了这些在 Chrome(我用来设计的浏览器)中缩小的图像,并且非常适合我的响应式设计。但是当我在 Firefox 中查看这个页面时,图像并没有从原来的大小缩小。 (IE9也有同样的问题。)

我正在使用以下 CSS:

.pics img {
    max-width: 100%;
    height: auto;
    width: auto\9; /* ie8 */
    border: 1px solid #CCC;
}​

这里有一个 jsFiddle:http://jsfiddle.net/S7ur2/

我环顾四周,但没有找到解决方案。如果您能帮助我,我将不胜感激。

【问题讨论】:

    标签: css responsive-design


    【解决方案1】:

    摆脱那些丑陋的auto,用width代替max-width
    http://jsfiddle.net/elclanrs/S7ur2/3/

    .pics {
        border-collapse: separate;
        border-spacing: 15px;
    }
    .pics img {
        width: 100%;
        border: 1px solid #CCC;
    }
    

    【讨论】:

    • 在 chrome 中,您示例中的图像宽度为 5 像素,不会增长。
    • @elclanrs:我们应该使用最大宽度而不是宽度来处理液体布局图像没有根本原因吗?
    猜你喜欢
    • 2011-06-12
    • 1970-01-01
    • 2011-08-22
    • 1970-01-01
    • 2011-11-07
    • 2014-02-18
    • 1970-01-01
    • 2021-09-04
    • 2011-12-16
    相关资源
    最近更新 更多