Skip to main content
How to Add an Overlay Over a Background Video

Learn how to use Divi’s built-in options and custom CSS to apply color overlays and gradient overlays to your background videos.

Updated over 4 months ago

Adding an overlay to a background video can enhance your content's visual appeal and readability by providing a stylish filter or effect. This technique helps to make text and other elements stand out against the moving background.

In this article, we will guide you through the process of adding an overlay over a background video in Divi.

  1. Open the Section settings by clicking on the Gear Icon

  2. In the Content Tab → Background → Background video

  3. Choose your video files (both mp4 and webm formats)

  4. Go to Advanced Tab Custom CSS Free Form CSS and add this code:

    selector::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
    }

Notes:

  • The color of the overlay is defined in this CSS rule background-color: rgba(0,0,0,0.6);

  • Instead of the background-color you can use the background-image property and define a linear-gradient for example background-image: linear-gradient(180deg,#0c71c3 0%,#29c4a9 100%)

Did this answer your question?