引导响应图像高度 [英] Bootstrap responsive image height

查看:79
本文介绍了引导响应图像高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的图像在相同的高度,同时响应,但我不明白如何做到这一点。

I need the images be in the same height and at the same time responsive, but I don't understand how to do this.

<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="container">
    <div class="row" style="text-align: center">
        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
            <img style="width : 100%" src="https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-frc3/t1/1743484_1417876895127107_960615052_n.jpg" alt="" />
        </div>
        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
            <img style="width : 100%" src="https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/t1/1016354_762185537132820_936517474_n.jpg" alt=""  />
        </div>
    </div>
</div>
</div>

http://jsfiddle.net/G26mN/

推荐答案

试试这个:

img {
width: inherit;  /* Make images fill their parent's space. Solves IE8. */
max-width: 100%; /* Add !important if needed. */
height: auto;    /* Add !important if needed. */
}

这篇关于引导响应图像高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆