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.

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.

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 *.

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

Latest From Divi Booster

Enable Automatic Looping for YouTube Videos in the Divi Video Module

Enabling automatic looping for YouTube videos in your Divi video module ensures that content plays seamlessly and continuously without interruption. This feature can enhance user engagement, highlight key information, or create dynamic visual effects on your website....

Hide Video Controls in Divi Video Module

Disabling YouTube video controls in the Divi Video Module helps create a seamless, distraction-free viewing experience for your site visitors. This approach is useful when you want full control over how your video content appears and is interacted with on the page, or...

Mute YouTube Videos by Default in the Divi Video Module

In the Divi Video Module, starting your YouTube videos muted by default can create a more user-friendly browsing experience on your webpage. It is particularly beneficial for reducing distractions, enhancing visitor engagement, and providing a seamless content preview...

Autoplay Videos in Divi Video Module

Enabling videos in your Divi video module to start playing automatically can enhance both the site's design and user engagement. To ensure full compatibility with browser requirements, such as Chrome's autoplay policy, it's often necessary to start your videos muted...

How to Add the Post Status in Divi's Dynamic Content

Divi's Dynamic Content feature is great for enhancing your post/page templates with post-specific information. While Divi includes an option to show information such as the Post Created Date using Dynamic Content, there is no equivalent option for the Post Status....

Random Divi Posts