Answer the question
In order to leave comments, you need to log in
How to stretch the background video to the entire block?
There is the following page: imatte.ru/work/toster/man.html
The video is inserted as follows:
<video autoplay loop muted class="bgvideo" id="bgvideo">
<source src="videos/man-page.mp4" type="video/mp4">
</video>
.bgvideo {
position: fixed;
left: 0;
top: 0;
min-width: 100%;
min-height: 100%;
height: auto;
width: auto;
z-index: 0;
}
Answer the question
In order to leave comments, you need to log in
<div class="video_wrap">
<video class="video_bg" autoplay="autoplay" loop="loop">
<source src="video.m4v" type="video/mp4" />
<source src="video.webm" type="video/webm" />
<source src="video.ogg" type="video/ogg" />
</video>
</div>
.video_wrap {
position: absolute;
overflow: hidden;
background: url(/img/poster.jpg) center repeat;
z-index: -999;
min-height: 870px;
max-height: 870px;
display: block;
width: 100%;
max-width: 2560px;
}
.video_bg {
display: block;
position: relative;
z-index: 0;
margin: 0 auto;
width: 125%;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question