我在最新版本中使用引導程序3 - 3.3.4
- 不幸的是.img-responsive
類無法正常工作。 我嘗試了一切,甚至.col-md-12
連同.img-responsive
一無所有。img-resposive不起作用
HTML:
<header class="container" id="container">
<div class="row">
<section class="col-md-3">
<a href="#">
<img class="img-responsive" src="http://placehold.it/350x150" alt="..." />
</a>
</section>
<section class="col-md-9">
<p>something else...</p>
</section>
</div>
</header>
CSS:
#container {
height: 60px;
background-color: red;
}
你可以看到實時預覽here。
@edit
的圖像是在容器 - 紅色部分 - 這是此問題的原因,.img-responsive
本來是要調整圖像大小,使其適合,但事實並非如此。
但是大小必須是60%,是不是'.img-responsive'應該調整圖像的大小? – yayuj
在這種情況下,您不需要響應式網站。您可以設置.img-responsive使其具有高度:60px。 –
我明白了,謝謝。 – yayuj