I have a video as the header of my website and I would like some text to appear on my entire video (with a half-transparent effect to be more readable). Unfortunately, it doesn't take the full height and I am not sure why.
How to change that?
I have put my example in a Fiddle
body {
margin: 0;
}
.title-container {
display: -ms-flex;
display: -webkit-flex;
display: flex;
}
section {
padding: 60px 0;
overflow: hidden;
}
#bloc-video {
padding: 0px 0px 0px 0px;
}
#myVideo {
min-width: 100%;
min-height: 100%;
}
.content {
position: absolute;
background: rgba(0, 0, 0, 0.2);
width: 100%;
height: 100%;
padding: 20px;
top: 0;
left: 0;
}
<section id="bloc-video">
<div class="title-container">
<video id="vid" loop muted autoplay>
<source type="video/mp4" src="https://storage.googleapis.com/coverr-main/mp4/Love-Boat.mp4">
</video>
<div class="content">
<h1>Video title</h1>
<p>Video text</p>
</div>
</div>
</section>
<main id="main">
<section>
<h1>
Text below video
</h1>
</section>
</main>