I am working on a hero section where I need to:
- Have a background video covering the full screen.
- Overlay an iceberg image on top of the video, positioned properly at the bottom.
- Ensure text is centered above both the video and the iceberg.
- Make it responsive so that the iceberg and text scale properly on different screen sizes.
.hero-section {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.hero-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: 1;
}
.iceberg {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60%;
max-width: 600px;
height: auto;
z-index: 2;
}
.hero-content {
position: absolute;
top: 35%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
color: white;
z-index: 3;
width: 80%;
}
<div class="hero-section"> <!-- Background Video --> <video class="hero-video" autoplay loop muted playsinline> <source src="https://lji-test.loyaltycloud1.com/assets/images/Aurora_video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
<!-- Iceberg Image -->
<img src="https://i.sstatic.net/nugUb6pP.png" class="iceberg" alt="Iceberg">
<!-- Overlay Content -->
<div class="hero-content">
<h1>THESE CHALLENGES DON’T HAVE TO DEFINE YOUR LOYALTY PROGRAM.</h1>
<p>Let’s turn the submerged into the summit with GRAVTY®.</p>
<a href="#" class="btn">CONTACT US</a>
</div>
</div>
Reference image:

Video reference
https://lji-test.loyaltycloud1.com/assets/images/Aurora_video.mp4
* { box-sizing: border-box; padding: 0; margin: 0; }