Transparent Background on Divi Header until Scroll using only CSS

February 21, 2021

Recently I was working on a new client's website using the Divi theme and they wanted a nice visual video background as the homepage hero, so to clean up the visual appeal of the site I wanted to set the Divi header background to transparent, and on scroll bring the background back in.

Below is my quick and not-so-dirty CSS to remove the Divi header background colour until scroll

body.home #page-container {
    padding-top: 0 !important;
}
body.home #main-header {
    background-color: transparent !important;
    box-shadow: none;
}
body.home header#main-header.et-fixed-header {
    background: #fff !important;
}

Please note that the code above is meant only for the homepage, if you remove the body.home it'll reflect on the entire site

Leave a comment below if you have a better way to achieve this or if this piece of CSS worked for you! Until next time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Work Experience
Andar Software Ltd.
Front-End Web Developer
08 / 2022 - Present
08 / 2015 - 06 / 2019
9345-1961 Quebec Inc.
Wordpress Developer
09 / 2021 - 08 / 2022
Yellow Pages
Front-End Developer
06 / 2019 - 11 / 2020
perpetual media ltd.
Developer
2011 - 2022
iPosco Systems Inc.
Web & Graphic Designer
12 / 2011
Technology Stack
Adobe Creative Cloud
HTML 5
CSS 3
JS / jQuery
PHP
mySQL / msSQL
Wordpress / WooCommerce
Shopify
Bootstrap
React
Solidity
web3.js
Laravel
Tailwind
AplineJS
Livewire
© 2024 PERPETUAL MEDIA LTD
rickypoon.ca
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram