How to Create Color Overlays for Divi Sections

[et_pb_section fb_built=”1″ custom_padding_last_edited=”on|desktop” admin_label=”section” _builder_version=”3.22″ custom_padding=”0px|||||” custom_padding_tablet=”50px|0|50px|0″ custom_padding_phone=”” transparent_background=”off” padding_mobile=”off” make_fullwidth=”off” use_custom_width=”off” width_unit=”off” custom_width_px=”1080px” custom_width_percent=”80%”][et_pb_row padding_mobile=”off” column_padding_mobile=”on” _builder_version=”4.4.8″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” max_width=”100%” custom_padding=”0px|||||” make_fullwidth=”off” use_custom_width=”off” width_unit=”on” custom_width_px=”1080px” custom_width_percent=”80%”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_video src=”https://www.youtube.com/watch?v=EfhzmIvwpDQ” image_src=”//i.ytimg.com/vi/EfhzmIvwpDQ/hqdefault.jpg” _builder_version=”3.0.47″][/et_pb_video][/et_pb_column][/et_pb_row][et_pb_row padding_mobile=”off” column_padding_mobile=”on” _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” max_width=”100%” width_unit=”off”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text admin_label=”Divi Background Plus” _builder_version=”3.27.4″ text_font=”|on|||” text_font_size=”18″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” border_style=”solid”]We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds.  It’s much easier and quicker than writing code.  It’s also a lot easier to update code.  In fact, no code is needed.  =)

Demo:  http://madebysuperfly.com/divi-background-plus/
Purchase:  https://besuperfly.com/product/divi-background-plus/
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row padding_mobile=”off” column_padding_mobile=”on” _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” max_width=”100%” make_fullwidth=”off” use_custom_width=”off” width_unit=”off” custom_width_px=”1080px” custom_width_percent=”80%”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text _builder_version=”3.27.4″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]The Fullwidth Header section in Divi gives you the option to create a background overlay. However, for standard sections (or any other location) that option is not available. This means you have to create the overlay on your photo using Photoshop or something similar. This makes it very difficult to change and test…

This tutorial will show you how to create a background overlay where it is not available in Divi. This overlay makes reading the text easier.

This doesn’t just make it easier to change and adjust using the Inspect Element tool, but also provides ease in adjusting photos and colors.

Check out the video above to learn how to implement the overlay effect in Divi today! We use ANTHEM in the video for demo purposes, but this will work on any Divi site.
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row column_structure=”1_2,1_2″ padding_mobile=”off” column_padding_mobile=”on” _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” max_width=”100%”][et_pb_column type=”1_2″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text admin_label=”before the overlay” _builder_version=”3.27.4″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

before the overlay

[/et_pb_text][et_pb_image src=”https://superfly-storage.s3.us-east-2.amazonaws.com/wp-content/uploads/2017/01/22135120/before-overlay.png” align=”center” align_tablet=”center” align_phone=”” align_last_edited=”on|desktop” _builder_version=”3.23″ animation_style=”fade” animation_duration=”500ms” use_border_color=”off” border_color=”#ffffff” border_style=”solid” animation=”fade_in” sticky=”off” always_center_on_mobile=”on”][/et_pb_image][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text admin_label=”after the overlay” _builder_version=”3.27.4″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

after the overlay

[/et_pb_text][et_pb_image src=”https://superfly-storage.s3.us-east-2.amazonaws.com/wp-content/uploads/2017/01/22135119/after-overlay.png” align=”center” align_tablet=”center” align_phone=”” align_last_edited=”on|desktop” _builder_version=”3.23″ animation_style=”fade” animation_duration=”500ms” use_border_color=”off” border_color=”#ffffff” border_style=”solid” animation=”fade_in” sticky=”off” always_center_on_mobile=”on”][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row padding_mobile=”off” column_padding_mobile=”on” _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” max_width=”100%” make_fullwidth=”off” use_custom_width=”off” width_unit=”off” custom_width_px=”1080px” custom_width_percent=”80%”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text _builder_version=”3.27.4″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” border_style=”solid”]

step 1: watch the video.

Go for it… it’s just a few minutes. It will save you time in the end since you’ll know how it all works!

step 2: go to “before” area in the section custom CSS

For this tutorial, we put all CSS in the section CSS itself. NOT in the Divi Custom CSS section in General Settings.

step 3: the trusty ol’ CSS.

Add the snippet of CSS below. Adjust colors as needed.

(step 3.5: if using parallax…)

Add the snippet of CSS below marked “if using parallax” into the “before” section. Then change the section class to “greyOverlay”.

[/et_pb_text][et_pb_toggle title=”gimme that code!” open_toggle_text_color=”#ffffff” closed_toggle_background_color=”#ec008c” admin_label=”Gimme that code!” _builder_version=”3.0.87″ title_text_color=”#ffffff” body_text_color=”#ffffff” background_size=”initial” background_position=”top_left” background_repeat=”repeat” use_border_color=”off” border_color=”#ffffff” border_style=”solid”] 


 /* PLACE IN THE BEFORE AREA */
content:"";
display: block;
height: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
background-color: rgba(58, 60, 69, .6);

 /* IF USING PARALLAX */
.greyOverlay .et_parallax_bg:before, .greyOverlay:before {
  content:"";
  display: block;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(58, 60, 69, .6);
}

 
[/et_pb_toggle][et_pb_text _builder_version=”3.27.4″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” module_alignment=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

step 5: tweak.

Feel free to play around with changing the CSS class to a few of the other options to find out which style works best for you!

Stay Fly,
Superfly Squad


You can use this trick on any Divi site! But if you like the demo we used, it’s called “ANTHEM” and it’s pretty fly if we may say so ourselves…

[/et_pb_text][et_pb_button button_url=”https://besuperfly.com/product/anthem-child-theme/” url_new_window=”on” button_text=”Buy the ANTHEM Theme” button_alignment=”center” _builder_version=”3.16″ custom_button=”on” button_text_size=”15px” button_bg_color=”#000000″ button_border_color=”#000000″ button_border_radius=”0″ button_letter_spacing=”0″ button_use_icon=”off” background_layout=”dark” button_border_color_hover=”#ec008c” button_border_radius_hover=”0″ button_letter_spacing_hover=”0″ button_bg_color_hover=”#ec008c” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”on” button_border_color__hover=”#ec008c” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”on” button_border_radius__hover=”0″ button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”on” button_letter_spacing__hover=”0″ button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”on” button_bg_color__hover=”#ec008c” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off”][/et_pb_button][/et_pb_column][/et_pb_row][/et_pb_section]

  • Pete
    January 13, 2017

    Excellent! I had this very issue only last week, did what you did at first however that wasn’t great.

    The way you show above is PERFECT! Thanks for sharing 🙂

    Pete

    Reply
  • Steve
    January 14, 2017

    Awesome! It’s such a pain the ass having to add overlays in Photoshop all the time.

    Crazy that Elegant Themes don’t have this functionality built into the Section settings.

    Thanks for the CSS!

    Reply
    • Nathan Duvall
      January 16, 2017

      Thanks, Steve. If ET doesn’t add this to the section settings at some point, we’d be surprised, but in the interim, this method will work. 🙂

      Reply
    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • Steve Cooper
    January 17, 2017

    Absolutely brilliant!

    The code works perfectly and your explanation was quick and easy to follow.

    Reply
  • Raquel
    January 17, 2017

    Genius! Cheers dude

    Reply
  • Javier
    January 21, 2017

    Hey great article!!
    I have a section with a background video at mostachomarketing.com. Can you please help me with the code I need to put a white overlay to the video?

    Thanks

    Reply
    • Nathan Duvall
      January 24, 2017

      Hi Javier, the trick on your site is to add this to your background video section > custom css > after box:

      content: ‘ ‘;
      background: rgba(255, 255, 255, 0.5); /*define background color or add gradient CSS*/
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;

      Then you’ll need to make sure your header text is on top of the gradient, just add a z-index to the text row > custom CSS > main element box.

      z-index: 1;

      Hope this helps!

      Reply
      • Gabriel Marusca
        April 19, 2017

        Hi Nathan,
        Thank you for this great tutorial. I’m trying to add an overlay background to a Fullwidth-Slider that has one video background slide.

        I added the below code in the custom css> after for that particular slide with no effect:

        content: ‘ ‘;
        background: rgba(2, 34, 66, 0.7) !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;

        The website link is this: https://idc.marusca.tech/
        Thank you in advance!

        Reply
        • Nathan Duvall
          May 11, 2017

          Hi Gabriel, what CSS selector were you targeting? What you have above works if you do something like this:

          .md-fw-slider .et_pb_slide:before {
          content: ”;
          background: rgba(2, 34, 66, 0.7) !important;
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          z-index: 1;
          }

          Reply
      • KC Clark
        May 21, 2017

        Hi Nathan,
        I’m trying to do the same thing here > http://thequiltsong.com/#the-song. I want to add an rgba (0, 0, 0, 0.43).

        Is this possible? I’ve tried adding a code you suggested here, but it doesnt seem to be working.

        Thanks,
        KC

        Reply
        • Jake Kramer
          May 22, 2017

          Hey KC! Thanks for the comment 🙂 Have you added this to your “Custom CSS” section in “Divi > Theme Options” and cleared your cache? Also, have you tried adding the “!important” tag?

          Reply
    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • ALLAN TODD
    January 27, 2017

    Hi
    What is the name of the css inspector you are using

    Thanks in advance
    Allan

    Reply
    • Nathan Duvall
      January 27, 2017

      Hi Allan — most of us use Coda as our CSS editor and just the built-in Chrome Inspect Element as our CSS Inspector.

      Reply
  • KL
    March 15, 2017

    I’m sorry, this is a rather dummy question but if I want to use the code in my child theme instead of the “Before” section in the divi builder do I just copy and paste it as it is? Or do I have to add something more?

    Reply
    • Jake Kramer
      March 16, 2017

      Hey KL, It depends on the specific code. Sometimes you have to add the “:before” cap to the CSS class or element. It really just requires some playing with. Hope that helps!

      Reply
      • KL
        March 16, 2017

        Hey Jake, thanks for answering so fast! And in the case of this tutorial what code should I put to my child theme?

        Reply
        • Jake Kramer
          March 16, 2017

          KL, the code needed is in step 3.5. Click on “gimme that code!”. Is that what you mean?

          Reply
          • KL
            March 18, 2017

            haha, no I meant how to use the code you provided in the stylesheet of my child theme. But I already found it out! Thank you guys! You’re doing awesome job with these tutorials

    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • Kate Doster
    April 4, 2017

    Thank you so much Jake. You have no idea how much this means to none coder DIYer like myself.

    Reply
  • Bethan Arundel
    June 23, 2017

    Hey, I’m using paralax and the code is not working. Only when I disable the paralax. Any idea of what I’m doing wrong?

    Reply
  • Vaibhav Dingre
    June 27, 2017

    Hello,

    I am new to using Divi Builder. Still, I have designed a full page for my site. Everything is OK but I want to add transparency or opacity to the background image of section module. I am tired of searching for it online. I can not write CSS codes as I am not aware of it. I just want to make module background image transparent so that the text on it looks better. Can anyone of you please suggest me how to achieve it using Divi Builder? I would really appreciate the help.

    Thanks.

    Reply
    • Haley Kramer
      June 27, 2017

      Vaibhav, to make your image transparent, you’ll need to either 1) put it into a photo editing tool like Photoshop and reduce the opacity or 2) add a opacity: .5; line of CSS to your element to reduce the opacity in half. Good luck!

      Reply
    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • Márcio
    July 3, 2017

    Hey man great tutorial. It worked well for images.

    But how can we make it work for video background? In my section, instead of an image I added a video to the background but it is too bright. How can I add an overlay to darken a bit?

    I’m not asking how to add an overlay to a video module, it a normal section, with a video background.

    Reply
    • Nathan Duvall
      August 12, 2017

      Hi Márcio, it should work the same, regardless of whether or not you’re using a video background or not. Feel free to reply with a link to your site and we’ll be glad to take a look.

      Reply
    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • Sam
    August 17, 2017

    OMG Dude Thanks so much for the code and the video!!

    Reply
  • Kadir
    August 19, 2017

    Thanks so much for the code.. I have a problem though, the code doesnt work when I enable parallax in the background image of a section. Can you help ?

    Reply
    • Terry Hale
      September 3, 2017

      Hi Kadir,

      Are you having trouble getting section 3.5 above in the article to work for you? Do you have a link to the page you are working on?

      Thanks for reaching out!

      Reply
    • John Wooten
      January 23, 2018

      Stay tuned Kadir… we’ll have a fix for this very soon… =)

      Reply
    • John Wooten
      January 24, 2018

      We now offer a plugin that brings this feature to Image Backgrounds, Parallax Backgrounds, and Video Backgrounds. It’s much easier and quicker than writing code. It’s also a lot easier to update code. In fact, no code is needed. =)

      Demo: http://madebysuperfly.com/divi-background-plus/
      Purchase: https://besuperfly.com/product/divi-background-plus/

      Reply
  • Bryan
    October 20, 2017

    Great work! Love your work. I did notice there is a typo for the class. gray vs grey
    In your text you have “Then change the section class to “grayOverlay”.” but in your code
    you have “.greyOverlay, .greyOverlay:before”

    Reply
  • Brett
    October 23, 2017

    I have used this on a blurb module with a background image that I won’t the overlay on.

    The css works but the overlay extends past the image and into the space below – between a blurb on the same column.

    I have tried removing the lower blurb and found the overlay continues to extend below the image.

    Reply
  • Doug Ison
    January 6, 2018

    Thanks what a great help and why I love DIVI. Is there a CSS snippet to draw a diagonal color section across a page section? This would be where you have 2 colors going across to opposite coners e.g. upper left to lower right top half white and bottom half yellow ?

    Reply
    • John Wooten
      January 23, 2018

      Doug you can do this using Divi’s Gradient Background feature now. However we’re coming out with a video on how to do this very soon. =)

      Reply
  • verum_est
    January 11, 2018

    Thanks much on this great tutorial!! Funny thing though is that when I pasted the given code with the Parallax Mode in the Theme Options, it works! But not on the main Section’s Advanced option anymore… Not sure why, but my best bet is the theme version, because I’m currently using the latest(At the time of this writing). More importantly, I think this post needs some updating on the information provided to consider versioning control.

    Reply
  • Marrell
    January 20, 2018

    I’m using the latest version of Divi, and I’m sure I’m using the correct code for parallax, but I can’t get it to work at all with parallax.
    If I disable parallax it works great. Could something have changed in the latest divi version?

    Reply
  • Robin
    June 2, 2018

    THANK YOU! THANK YOU!! THANK YOU!!! I really needed this plugin. I tried everything, including the code. Nothing worked above my video. Y’all are AWESOME!

    Reply
  • Dianne Emerson
    September 4, 2018

    By reading this post now I don’t have any issue about overlays color divi section. So helpful for me. Thanks

    Reply

Talk It Out.

Leave A Comment