我一直在試圖將視頻嵌入到引導程序網站。Bootstrap響應式嵌入視頻佔用了整個屏幕的寬度和高度
但是當我這樣做,它佔據了整個屏幕的寬度和高度。我希望桌面上的大小爲560px x 315px,桌面大小低於560px時,它應該是有響應的。
我用:
<div class="container-fluid">
<div class="embed-responsive embed-responsive-16by9 div_style">
<iframe class="embed-responsive-item" src="http://www.youtube.com/embed/XGSy3_Czz8k" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
</div>
當我嘗試通過添加div_style
類max-width: 560px;
和max-height:315px;
定製div
標籤,它改變了視頻寬度560像素,但身高佔據了整個頁面高度。
嘗試添加**!important **,max-width:560px!important;最大高度:315px!重要。希望能幫助到你。 – mainronindeveloper
可以請你分享整個HTML文件,,,大塊代碼?其他部分可能有問題。 – Junaid