I'm trying to have a full page video background as the landing page for my site. I have the width correct but it doesn't fit the page (there's a white rectangle of nothingness at the bottom). Also, when I scroll, it allows me to pull up and see more blank space.
How do I get the video to fit the page and not move?
Here's the code:
* {
margin: 0;
padding: 0;
}
.video-section {
position: relative;
width: 100%;
max-height: 150%;
overflow: hidden;
}
#video-elem {
width: 100%;
height: 200%;
}
video::-webkit-media-controls {
display:none !important;
}
.video-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(255, 255, 255, 0.8);
opacity: 0;
transition: opacity 0.3s ease;
}
.video-overlay:hover {
opacity: 1;
}
.video-overlay h1 {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
text-transform: uppercase;
font-size: 3em;
color: #000;
text-align: center;
}
<div class="video-section">
<video id="video-elem" preload="auto" autoplay="true" loop="loop" muted="muted" poster="Inclusiv.png">
<source src="inclusiv.mp4" type="video/mp4">
Video not supported
</video>
</div>
I would also like to put in a transparent drop-down navigation menu if you're feeling really helpful.