【问题标题】:Scale image down to fit on mobile devices is not working缩小图像以适应移动设备不起作用
【发布时间】:2014-12-04 17:34:05
【问题描述】:

我正在处理一家公司的员工团队页面HERE.

我的问题是员工的图片在移动设备上显示时不会按比例缩小。

我的 CSS 是这样的:

@media (max-width: 767px) {
    .employee-image {
        max-width: 85%;
        max-height: 85%;
    }
}

也许我在某处有冲突的 CSS?我不知道。

页面链接:http://texasca.com/team

CSS 链接:http://texasca.com/includes/team.css

【问题讨论】:

  • 对相应媒体查询中的图像使用 width:100%。所以你的媒体查询应该是这样的:“@media (max-width: 767px) { .employee-image { max-width: 200px; width:100%; } }”

标签: html css image resize


【解决方案1】:

看起来您正在使用引导程序。在引导程序中,您有一个名为 .img-responsive 的帮助程序类。你可以用.img-responsive替换.employee-image,我想你会得到想要的结果。

为了更清楚 - 只需将 img-responsive 类添加到所需的图像。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多