我試圖在我的網站上建立一個傳送帶,但我的圖像沒有相同的高度。 我在網上搜索,我很驚訝沒有人使用「img-responsive」類,這實際上不起作用,或者我沒有正確地使用它...Bootstrap傳送帶高度
所以我的問題是;爲什麼「img-responsive」類不能正常工作? (P.S.我試圖固定傳送帶內部類的最大高度,但圖像不能正確調整大小)
這是我的代碼,任何人都可以幫助我嗎?
<div class="row">
<div id="Carousel" class="carousel slide col-lg-12" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#Carousel" data-slide-to="0" class="active"></li>
<li data-target="#Carousel" data-slide-to="1"></li>
<li data-target="#Carousel" data-slide-to="2"></li>
<li data-target="#Carousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner col-lg-12" role="listbox">
<div class="item active">
<img class="img-responsive" src="Images/Articles/Suisei_no_gargantia.jpg" alt="Suisei_no_gargantia">
<div class="carousel-caption">
<h4>Header</h4>
<p>Sample text</p>
</div>
</div>
<div class="item">
<img class="img-responsive" src="Images/Articles/Pokemon.jpg" alt="Pokemon">
</div>
<div class="item">
<img class="img-responsive" src="Images/Articles/Nisekoi.jpeg" alt="Nisekoi">
</div>
<div class="item">
<img class="img-responsive" src="Images/Articles/High_School_Of_The_Dead.jpg" alt="High_School_Of_The_Dead">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#Carousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#Carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
我找到了解決辦法由muself將其加入此CSS'.carousel-內.item img { \t height:300px; \t margin:auto; } '但我只是想知道如果他們是爲什麼bootstrap img-responsive類不能正常工作的原因 –