0
我正在學習網絡開發,並試圖建立一個網站。我試圖製作一個輪播,但與YouTube視頻。我擁有的是工作,但它拒絕調整我的需求。爲什麼我的YouTube嵌入拒絕在視頻輪播中調整大小?
但這就是我想要的,離全屏最近,但我想保留來自旋轉木馬的左/右導航,並讓它們出現在視頻內容的頂部。
這裏是我的代碼:PLS,看看:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.carousel-inner > .item > iframe,
.carousel-inner > .item > a > img {
width: 100%;
margin: auto;
}
</style>
</head>
<body style="height:100%;">
<div style="height:100%;">
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="height:100%;">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox" style="height:100%;">
<div class="item active" style="height:100%;">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0?autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<div class="item" style="height:100%;">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0?autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<div class="item" style="height:100%;">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0?autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<div class="item" style="height:100%;">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0?autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" 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="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</body>
</html>
我不知道html標籤本身可能有屬性。非常感謝 - 現在工作。 :) –