Html 引导响应图像高度
我需要的图像在同一高度,同时响应,但我不知道如何做到这一点Html 引导响应图像高度,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我需要的图像在同一高度,同时响应,但我不知道如何做到这一点 <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">
<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>
试试这个:
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. */
}
您缺少一个结束标记。还是仅仅是打字错误?在我看来,写问题时的错误(已修复)你必须给出固定的高度或使用更大的图像。你能把代码放在JSFIDLE上进行测试吗?谢谢如果我给一个固定的高度,它在其他设备上看起来会很糟糕谢谢你的帮助,但是左右图像的高度不一样:(谢谢你的帮助,但是我需要图像在相同的高度和时间
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. */
}