圖像在頁面中心未正確對齊。相反,它會在頁面左側對齊。此外,圖像大小各異。所以,如何讓它修復一個特定的尺寸並使其響應。請檢查下面的代碼是相同的 -圖像在引導程序中未正確對齊傳送帶
#carousel-custom {
margin: 20px auto;
width: 100%;
\t height: auto;
}
#carousel-custom .carousel-indicators {
margin: 10px 0 0;
overflow: auto;
position: static;
text-align: left;
white-space: nowrap;
width: 100%;
}
#carousel-custom .carousel-indicators li {
background-color: transparent;
-webkit-border-radius: 0;
border-radius: 0;
display: inline-block;
height: auto;
margin: 0 !important;
width: auto;
}
#carousel-custom .carousel-indicators li img {
display: block;
opacity: 0.5;
}
#carousel-custom .carousel-indicators li.active img {
opacity: 1;
}
#carousel-custom .carousel-indicators li:hover img {
opacity: 0.75;
}
#carousel-custom .carousel-outer {
position: relative;
}
<!-- begin snippet: js hide: false -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<div id="myPicture" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target = "#myPicture" data-slide-to="0" class="active"></li>
<li data-target = "#myPicture" data-slide-to="1" ></li>
<li data-target = "#myPicture" data-slide-to="2" ></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/250x350" alt="test" class="img-responsive">
</div>
<div class="item">
<img src="http://placehold.it/300x350" alt="test" class="img-responsive">
</div>
<div class="item">
<img src="http://placehold.it/200x350" alt="test" class="img-responsive"> \t \t \t \t
</div>
</div>
<a class="carousel-control left" href="#myPicture" data-slide="prev"><span class ="icon-prev"></span></a>
\t \t \t <a class="carousel-control right" href="#myPicture" data-slide="next"><span class ="icon-next"></span></a>
\t \t </div>
請提供Plunker例子,所以我可以看到你的問題。我無法重現您的錯誤。你有沒有試圖把它包裝在一個容器和一排? –