我是新的HTML,CSS,JS等試圖自動調整大小的YouTube窗口,以適應設備的屏幕,但它不適合我。 我已經嘗試了很多在這個網站給出的解決方案,似乎沒有任何工作。 這裏是代碼爲視頻部分無法根據設備自動調整YouTube的播放器的尺寸
HTML
<div class="wrapper">
<div class="h-iframe">
<iframe class="center-block" src="https://www.youtube.com/embed/Npa-z3P1FTY" frameborder="0" allowfullscreen></iframe>
</div>
</div>
CSS
.h_iframe iframe {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.wrapper {
position: relative;
width: 100%;
}
謝謝,終於有所作爲,我很感激。 –
不用客氣 – mlegg