How To Make The Divi Mobile Menu Dropdown Scrollable Tutorial by Pee Aye Creative

How To Make The Divi Mobile Dropdown Menu Height Scrollable

Nelson Miller Pee Aye Creative
In this tutorial I will show you how to make the Divi mobile dropdown menu height scrollable so it does not get cut off when there are too many menu items.

FYI: You can do this with a setting directly in the Divi Builder with our popular Divi Responsive Helper plugin! Take a look, it is so easy!

Divi Responsive Helper by Pee Aye Creative 2.3

Join subscribers on our YouTube channel and enjoy other Divi video tutorials!

Add Some CSS To Make The Divi Mobile Menu Dropdown scrollable

This tutorial is very easy because it only involves copying and pasting a simple CSS code snippet into your website. After that, your mobile menus that contain a lot of menu items will work great for your visitors.

If you are using our free Divi child theme, place this snippet into the style.css file. Otherwise, place this in your Divi>Theme Options>Custom CSS code box. If you need help, check out our complete guide on Where To Add Custom Code In Divi.

/*make the Divi mobile dropdown menu scrollable*/

.et_mobile_menu {
overflow: scroll !important;
max-height: 80vh;
}

The max-height value in the provided code can be changed to suit your needs. The 80vh means 80% of the viewport height. This value seems to work well.

Do It With A Setting!

Make life easier and use the Divi Responsive Helper instead, the ultimate Divi responsive toolkit with awesome features and settings to help make your website look and work great on all devices!

Divi Responsive Helper by Pee Aye Creative 2.3

Here is the setting when using our plugin, it doesn’t get easier than this!

set the mobile menu scrollable height setting in the Divi Responsive Helper 2.3

Last updated Mar 17, 2023 @ 4:21 pm

Subscribe

Each month we send out a roundup email newsletter with the latest tutorials, product updates, helpful resources, and any other industry or personal news. Occasionally we send an extra separate email here and there if we just can’t wait! So that’s what you will get if you subscribe, and you can always unsubscribe at any time if you just can’t take it anymore :)

Blog Post Optin

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

Nelson is the owner of Pee-Aye Creative in the beautiful state of Pennsylvania. He loves helping small businesses, exploring outdoors, building websites with Divi, and teaching others.
Pee Aye Creative Black Friday Sale

Our Once A Year Sale Is Happening Now!!!

25% OFF all Divi Plugins, Courses, and Child Themes!

Shop The Sale Now!

Asset 7

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Pee Aye Creative Black Friday Sale

Our Once A Year Sale Is Happening Now!!!

25% OFF all Divi Plugins, Courses, and Child Themes!

Shop The Sale Now!

î‚£

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

10 Comments

  1. Gonçalo Peres

    Greetings and thank you for this tip. Unfortunately, I can’t get this to work. I’ve applied the CSS fix to the .et_mobile_menu element, but only the page scrolls, not the menu.
    Here’s the website: https://bicicultura.org/

    Reply
    • Gonçalo Peres

      Ops, I found the problem. It was this CSS code that was removing pointer events from the menu altogether:

      .et_pb_module .et_mobile_nav_menu { pointer-events: none; }

      I removed it and now it works as expected.

      Sorry for the trouble!

      Reply
  2. Ilenia

    Hello! Thank you very much…many time that i’m looking for this solution!!! GREAT.

    Reply
  3. Dirk

    Hey thanks, works great. Is it possible to make the scrollbar invisible? So you don’t see it?

    Reply
  4. Mike

    If you want to maximised the available screen realestate there are a couple of things you can do to make this a bit better.

    1. Instead of using vh units you could use the new dvh unit – this will avoid issues with UI elements blocking the bottom of your menu (looking at you iOS Safari)
    2. If you have a statically sized header section, then you can use a calc function as well as dvh unit to make the menu always take up all available space without ever being too big.

    .et_mobile_menu {
    max-height: calc(100vh – 80px); /* fallback for a couple of more obscure mobile broswers that don’t yet support ‘dvh’ units */
    max-height: calc(100dvh – 80px); /* 80px = expected max height of header – update for your use case */
    overflow: scroll !important;
    }

    3. If you have a dynamically sized header, you can add the max-height as above but on ‘resize’ using JS. I made a script that does this for a project recently.
    https://github.com/DigitalServicesLab/Divi-Dynamic-Mobile-Menu-Height/tree/main

    Reply
    • Hemant Gaba

      Hi Mike!

      Thank you for sharing the details with us. We’ll test it and update the guide!

      Reply
  5. Bradley Boardman

    Which video is it that shows how to get this same functionality on the Desktop vertical menu?

    Reply
    • Hemant Gaba

      Hi Bradley!

      Please use the following code for the desktop dropdown:

      #main-header .nav li ul,.et_pb_menu .et_pb_menu__menu>nav>ul>li>ul{
      height: 25vh;
      overflow: auto;
      }

      Let me know how it goes!

      Reply

Submit a Comment

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

Recent Posts

0

Your Cart