css video background

Solutions on MaxInterview for css video background by the best coders in the world

showing results for - "css video background"
Corbin
28 Jun 2017
1<div class="fullscreen-bg">
2    <video loop muted autoplay poster="img/videoframe.jpg" class="fullscreen-bg__video">
3        <source src="video/big_buck_bunny.webm" type="video/webm">
4        <source src="video/big_buck_bunny.mp4" type="video/mp4">
5        <source src="video/big_buck_bunny.ogv" type="video/ogg">
6    </video>
7</div>
8
9<!-- CSS -->
10.fullscreen-bg {
11    position: fixed;
12    top: 0;
13    right: 0;
14    bottom: 0;
15    left: 0;
16    overflow: hidden;
17    z-index: -100;
18}
19
20.fullscreen-bg__video {
21    position: absolute;
22    top: 0;
23    left: 0;
24    width: 100%;
25    height: 100%;
26}
Valeria
20 Sep 2020
1.bg-vid {
2  object-fit: cover;
3  width: 100vw;
4  height: 100vh;
5  position: fixed;
6  top: 0;
7  left: 0;
8}
similar questions
queries leading to this page
css video background