I'm having trouble creating a full-width video cover for the header of a website. Can someone help me troubleshoot what I'm doing wrong?
Here is a snippet of my code:
<section id="home">
<video poster="assets/img/home-bg.png" autoplay="autoplay" loop="loop" id="bgvid">
<source src="assets/video/garage-video.mp4"" type="video/mp4"/>
<!-- <source src="assets/video/trailer.webm" type="video/webm"/> -->
</video>
<div class="filtro">
<div class="logo">
<img src="assets/img/garage-logo-blanco.png" alt="logo garage">
</div>
Here is the corresponding CSS:
section#home video {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
min-height: 100vh;
width: 100%;
height: 100vh;
object-fit: cover;
z-index: 1;
}
.filtro {
z-index: 2;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(40, 88, 162, .55);
}
If you want to see the full code, you can check it out here.
You can also see the demo of the website here, where you might notice the extra right padding issue I'm facing.