0
我實現我的這個代碼引導視頻輪播:自舉影音傳送帶高度
<div class="row">
<h2>Videos</h2>
<hr />
<div class="carousel slide" id="videoCarousel" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#videoCarousel" data-slide-to="0" class="active"></li>
<li data-target="#videoCarousel" data-slide-to="1"></li>
<li data-target="#videoCarousel" data-slide-to="2"></li>
<li data-target="#videoCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<iframe width="100%" height="100%" src="//www.youtube.com/embed/SEBLt6Kd9EY?controls=0" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
<div class="item">
<iframe width="100%" height="100%" src="//www.youtube.com/embed/SEBLt6Kd9EY?controls=0" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
<div class="item">
<iframe width="100%" height="100%" src="https://youtu.be/pVgtPovVSbY" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
<div class="item">
<iframe width="100%" height="100%" src="//www.youtube.com/embed/SEBLt6Kd9EY?controls=0" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#videoCarousel" 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="#videoCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">c</span>
</a>
</div>
</div>
我使用相同的代碼的圖像旋轉木馬和一個我明明使用IMG而不是iframe和標籤的元素顯示。我只是不明白爲什麼在視頻輪播的情況下,我將視頻顯示在固定的高度,如果我通過CSS更改視頻,則視頻始終以相同的高度呈現,但在具有空白空間的框架內呈現。
爲了讓自己更清晰,我希望輪播展示視頻的尺寸爲800x600或類似,因爲它們在YouTube上。我不熟悉引導程序或使用傳送帶,所以我想我缺少一些非常基本的東西...
在此先感謝您的幫助!