Immersive Video Background Hero

A cinematic, full-bleed video hero section featuring smooth gradient overlays, lazy loading for performance, a custom play/pause controller, and mobile-friendly image fallbacks.


Immersive Video Background Hero


Make a stunning first impression. This Immersive Video Background Hero provides a beautifully responsive, cinematic entrance for any modern landing page. It balances visual impact with performance through deferred loading and mobile fallbacks.

Component Highlights

Implementation Guide

The HTML Structure

The hero relies on a relatively positioned wrapper with the video pinned absolutely to the back. A separate .overlay div ensures text contrast.

<section class="video-hero">
  <!-- The background video element -->
  <video class="hero-video" id="bg-video" loop muted playsinline poster="/path/to/poster-image.jpg">
    <!-- Source injected by JS for lazy loading -->
  </video>
  
  <!-- Gradient Overlay -->
  <div class="hero-overlay"></div>

  <!-- Foreground Content -->
  <div class="hero-content">
    <h1>Experience the Future</h1>
    <p>A cinematic journey begins right here on your landing page.</p>
    
    <div class="hero-actions">
      <button class="btn-primary">Get Started</button>
    </div>
  </div>
</section>

The Video Object-Fit Trick

To ensure the video scales like a background image without skewing proportions, we use the object-fit: cover property.

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(15, 23, 42, 0.4) 50%,
    rgba(15, 23, 42, 0.9) 100%
  );
  z-index: 2;
}

Drop this into your project, attach an .mp4 file URL to the Javascript initializer, and instantly elevate your landing page design!