-1
正如您在我提供的視頻中看到的視頻不是全寬,我希望它適合容器的其餘部分。誰能告訴我什麼,我做錯了,這裏是圖像: Image of the div and video視頻將不會填充容器的寬度
代碼:
HTML
<section class="content-2">
<div class="fullscreen_bg">
<video loop muted autoplay poster="img/videoframe.jpg" class="fullscreen-bg_video">
<source src="images/Ajvar.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video></div>
</section>
CSS
.content-2 {
height: 350px;
overflow: hidden; }
.fullscreen-bg {
max-height:350px;
width: 100%;
height: 100%;
position: relative;
padding:0;
margin:0;
left: 0px;
top: 0px;
z-index: -1000;
overflow:hidden;}
.fullscreen-bg__video {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
z-index: -100;
background-size: cover;
overflow: hidden;}
@media (min-aspect-ratio: 16/9) {
.fullscreen-bg__video {
height: 300%;
top: -100%;
}
}
@media (max-aspect-ratio: 16/9) {
.fullscreen-bg__video {
width: 300%;
left: -100%;
}
}
把你的視頻代碼中的div fullscreen_bg內 –
感謝您的答覆,我做到了,但還是同樣的事情:/ –