Preventing the Divi Theme Horizontal Scroll-Bar Bug

Written by Dan Mossop

There is a minor bug in the Divi Theme which causes the horizontal scroll bar to be shown and allows the user to scroll a little bit past the edge of the main blog. Here's how to fix it.

First, an example of what I'm talking about.

divi theme scroll bar bug

Notice that the horizontal scroll bar is showing, and that having scrolled as far as I can go, I'm now slightly off the side of the page and can see the edge of the header bar.

It took me a while to track down the culprit. All the visible components of the screen were correctly staying within the bounds of the normal screen size. The offending component, then, had to be something invisible! Turns out it is the drop-down submenu which causes the problem, as can be seen here:

divi theme scroll bar bug - submenu

So how do we fix the issue? It's as simple as adding the following CSS to the theme:

#page-container { overflow:hidden; }

This forces the part of the menu which spills over the page to be hidden from view. The result is that the horizontal scroll bar is no longer shown and you can't scroll past the edge of the screen.

Here's the final result. Notice the lack of horizontal scroll bar this time:

divi theme scroll bar bug - fixed

The fix doesn't seem to cause an issue actually accessing the menus. But be sure to check on your own site just to be sure.

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

Supercharge Your Posts with AI-Driven CTAs

Resolve issues like the Divi horizontal scroll bar bug while boosting your site's engagement. Use WP Magic CTAs to transform each post with AI-generated call-to-actions that increase conversions effortlessly. Perfect for directing users to helpful resources after solving technical glitches.

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

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, 

34 Comments

  1. Thank you for this. I was losing sleep over this one. Divi does now have an option where you can prevent horizontal scrolling on a page by page basis in the page options/advanced menu. But your solution is way easier for the whole site.

    Reply
    • You're welcome, Scott. I'm glad it helped. I hadn't noticed the page by page option before so thanks for pointing out.

      Reply
  2. Thanks

    Reply
  3. Thank you for this! Lucky me I found this on Google :)

    Reply
  4. This is a great little solution when you've been using custom margins etc for overlaying images across different modules.

    Reply
  5. Thanks so much – a very helpful piece of information!!!

    Reply
  6. Wow! Thank you so much for this!

    I didn't even notice it until i was on mobile.

    Reply
  7. Thank so much! This saved me some headaches!

    Reply
  8. Thank you! My client was complaining about this and I had no idea as I'd never had this problem in Divi before.

    Reply
  9. Hello, thanks a lot. It was really irritating.

    Reply
  10. Oh my gosh! I have been struggling with this on sooo many of my sites. I customise everything, so I kept thinking it had something to do with my customisation..

    Thank you, thank you, thank you!

    Reply
  11. that was awesome. i'm still surprised at all the little bugs in Divi – I appreciate it and like it, but as someone not fully fluent in CSS, it drives me crazy sometimes. Thanks for this.

    Reply
  12. I was pulling hair out for 3 days over this issue. I'd probably be bald if it wasn't for this article! That CSS worked like a charm. You are a lifesaver!

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