Making the Divi Box Layout Overlap the Header

Written by Dan Mossop

While the Divi Theme doesn't seem to have support for making the box layout main area overlap the header navigation bar, we can achieve the effect quite easily.

Here's what the result will look like:

divi theme main area overlapping the header bar

To achieve this effect, first disable the fixed navigation bar in the ePanel (under General Settings), and put Divi into Boxed Layout mode (under Appearance > Customize > Theme Settings).

Now add the following CSS to Divi:

@media only screen and ( min-width: 1200px ) {

    /* Remove the current box shadow */
    #page-container, #main-header { 
        -moz-box-shadow: none !important; 
        -webkit-box-shadow: none !important; 
        box-shadow: none !important; 
    }
	
    /* Add box shadow to just the main area instead */
    #et-main-area { 
        position:relative; 
        -moz-box-shadow: 0 0 10px 0 rgba(0,0,0,0.2); 
        -webkit-box-shadow: 0 0 10px 0 rgba(0,0,0,0.2); 
        box-shadow: 0 0 10px 0 rgba(0,0,0,0.2); 
    }

    /* Push the header behind the main area */
    #main-header { 
        z-index:0; 
    }
	
    /* Set a height for the new header area */
    body {
        padding: 0px;
        height:120px; 
    }
	
    /* Set the same background color on the new header area and original header */
    body, #main-header { background-color: #89d7d7 !important; }
	
    /* Set the background color for the rest of the page */
    html { background-color: #fafafa !important; }	

}

The CSS removes the shadowing from the header bar and creates a new header area which comes down lower that the current header. By giving both of these areas the same background color, they appear to blend into a single area which extends below and behind the main area.

Note that the effect only shows on full size screens. For smaller screens the default Divi layout is used.

We may earn a commission when you visit links on our website.

Do More with Divi Dynamic Content!

Enhance your site's flexibility with the Divi Dynamic Content Extended plugin. Unlock dynamic content on more module fields and access data from ACF, Meta Box, and Pods settings pages, making your Divi designs smarter and more efficient.

Latest Posts

Add a Visible Shadow to Divi Gallery Lightbox Arrows

Give the lightbox navigation arrows in your Divi galleries a stylish pop and improve their visibility by adding a shadow beneath the arrows. This quick guide will show you how to make your navigation arrows stand out against the lightbox overlay.Add a Visible Shadow...

Adjust Lightbox Arrow Size in Divi Gallery

Customize the size of the navigation arrows that appear in your gallery lightbox so they’re easier to see and aligned with your site’s design. Whether you want larger, more accessible controls or a subtler look, setting a precise arrow size creates a more polished...

Change Lightbox Arrow Color in the Divi Gallery Module

Make the lightbox navigation arrows in your Divi Gallery match your brand and stand out against your images by assigning a custom color. This improves visual consistency, enhances accessibility with better contrast, and elevates the overall browsing experience for...

Change the Divi Gallery Module Grid Image Scaling

Divi’s Gallery module offers a great way to showcase images, but it can sometimes stretch or crop them in unwanted ways. This article explains how to manage the module’s image scaling behavior to ensure your images are displayed at the correct size and aspect...

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

4 Comments

  1. I've found that when any Google Translate plugins are running (I've tried three different ones), the point where the header background colour meets the body background colour gets pushed right down near the bottom of the screen. Is there anything that can be modified in the code to prevent this? Examples of the translate plugins are Google Language Translator, Google Website Translator by Prinsa, and GTranslate. They all have the same problem.

    Reply
    • Hey Dan, how odd. I've just tried the plugins out and don't get that problem, so there must be some difference in our setups. Is there any chance (if it's not to disruptive to your site) that you'd be able to send me a link to your site with one of these plugins enabled so that I can take a look? If it makes things look better, feel free to set the header and body backgrounds to the same color – I'll be able to figure out what is what. Thanks!

      Reply
  2. Thank you! This had been a problem for me for so long and this CSS cleared it up immediately. I used it with box layout disabled and it worked just fine.

    Reply
  3. Thank you so much!

    Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

Works with Divi 5

This feature has been tested and confirmed to work with Divi 5.

Works with Divi 4

Divi Booster

Hundreds of new features for Divi!

All licenses are lifetime – pay once, use forever.