Changing the Divi Submenu Link Hover Color

Written by Dan Mossop

On the Divi theme, when you open a drop-down menu and hover over a particular menu item, the item's background color is changed to highlight the item. If you want to change this color, or get rid of the hover effect (by setting its color to the same as the actual menu), you can do so with the following CSS:

#top-menu li li a:hover { 
    background-color:#fff0f0; 
}

Here's the result:

Fixed / Scrolled Header

To set a separate submenu item hover color when the header is "fixed" (i.e. when it remains at the top of the page after you've scrolled down), you can use the following CSS:

.et-fixed-header #top-menu li li a:hover { 
    background-color: #ddd; 
}

Transform Your Pages with Divi Show / Hide Button!

Unleash the full potential of your Divi site with the Divi Show / Hide Button Module. Control the visibility of sections, rows, or modules with ease, create engaging tabs, and style your buttons just like any other Divi button. Perfect for keeping your pages clean and interactive.

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, 

13 Comments

    • Figured it out by looking at some of your suggestions.

      Reply
  1. Hi Dan, What if I want difference color for each submenu in Dropdown Menu?

    Reply
    • Hi Tien, you can use something like this:

      #top-menu li:nth-child(3) li:nth-child(2) a:hover { background-color: red !important; }
      

      The "li:nth-child(3)" part applies the rule only to the third main menu item from the left. Then the next "li:nth-child(2)" applies the rule only to the second item from the top in that main menu item's drop down menu. By adding more copies of this rule, you can set different background hover colors for each submenu item.

      Hopefully this does what you need, but let me know if I've misunderstood you. Thanks!

      Reply
  2. Hi Dan,

    I'm trying to use a variation of your CSS (removing "a:hover") to change the background color of my drop down menus. It almost works, but it's leaving white space at the top and bottom of the menu, presumably because I'm only changing the background color of the menu items, not the menu itself. Any thoughts?

    Reply
    • Hi Adrien, Divi actually has a setting for this in the Theme Customizer under "Header & Navigation > Primary Menu Bar > Dropdown Menu Background Color".

      If you do need to do it manually, something like this should work:

      #main-header .nav li ul.sub-menu { background-color: green !important; }
      
      Reply
      • Thank you so much!

        Reply
  3. dear dan
    i want to change the hover color in footer menu.
    Normal state grey and on hover white.
    Could you please help me?

    Reply
    • Hi Nikos, you should be able to change the hover color to white using the following CSS:

      .bottom-nav .menu-item a:hover { color: white; opacity: 1; }
      
      Reply
      • Dear Dan excellent solution , much obliged.

        Reply
  4. If you open my divitheme based website and hover your mouse over gallery you'll see that there's a gap between the submenu's box and the menu. Could you please help me fixing this? thanks a lot in advance.

    Reply
    • Hi fabíola, did you get this working? When I look on Chrome and IE the submenu box is nicely touching the menu – there is no gap. If you're still seeing it, let me know what OS / browser you are using and I'll see if I can replicate it. Thanks!

      Reply
  5. THANK YOU! This has been driving me crazy for about a week now.

    Lynn

    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

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

Fix Divi Text Module "Regular" Font Weight Not Working

Are you encountering an issue where the font weights in Divi's Text Module don't seem to apply as expected? In particular, you might find that when you set the text module's body text font weight to "Regular", your font is actually assigned a weight of 500 instead of...

Make the Divi Gallery Module Swipeable

The Divi Gallery Module comes with a slider mode that lets you display images in a slider with clickable left/right arrows to scroll through the images. For mobile / touchscreen users, you can improve the user experience by allowing your user to swipe to navigate to...

How to Use Divi Dynamic Content in Woo Modules Product Selector

Divi's Dynamic Content is a powerful feature that lets you populate your Divi modules and theme builder templates with data pulled in various sources, such as custom fields. This allows for efficient organization and maintenance of your sites.Unfortunately, Divi's...

Random Divi Posts