Ready-to-use CSS snippets for your Divi Menu module!
The Divi Menu module doesn’t have hover styles apart from a basic link color change. In this simple tutorial, you’ll find a list of seven different hover effects with animated underline. We made it super easy to customize with CSS variables, so that you can change the line color, the height and offset to make sure the fun effects work perfectly with your Menu module and match the rest of your website design style.
Free Resources for Divi Lovers
Join our newsletter to get the good stuff!
We’ll provide you with updates on new tutorials, webdesign assets and special offers. Get top quality Divi goodies straight into your inbox! Read our Privacy Policy to learn how we manage and protect your submitted information.
Sign up to download
Get access to this layout and all the free resources made exclusively for our subscribers!
Already subscribed?
Fill the signup form and if you’re on the list it’ll get you straight to the download page!
Can’t see the form? Click here
Hello,
I can’t seem to get the hover effect to work. I named the CSS class – dl-menu-style1 in my menu settings
Add this code into the main menu element – /* Change these values to edit line appearance and position */
:root {
-BottomOffset: 20px;
-LineHeight: 5px;
-LineColor: #f42179;
}
and add the /* Menu Hover Effects Style 1 */ CSS into the theme options CSS.
I kinda got the code to work once but the hover effect was wonky.
Thanks Ania, awesome as ever
how to add the CSS for active link?
Using a new selector with a CSS class of current-menu-item added to a li element (see my reply below).
Thanks for this awesome css !
Using the style1, I reduced the bottom bar width by 50% but I can’t find how to center it. It’s still on the left.
Can you help me ?
Can you share your URL?
Hi Ania,
How can I keep the hover effect on the active links?
Thanks, Paul
Hi Paul!
You’d need to edit the CSS code a little bit. Every time there is a :hover state inside the selector, for example in
.dl-menu-style6 ul.et-menu>li>a:hover:before {
you’d need to add a secend selector with the current-menu-item class, like this:Hopefully, this helps.
Hello Ania
Are the same hover effects available in your DiviToolbox addon?
If not is it possible to add them to the addon?
Thanks.
Pete
Hi Ania
I have added the CSS Class to my Menu Module settings.
As I am working in the Divi theme builder, I then added your CSS code into the Header Template Settings > Advanced Tab > Custom CSS The code works but throws up a lot of errors.
Specifically, in the CSS Code (That we need to copy first) it is looking for a RBRACE after each variable.
Then in the main body of code it warns of unexpected inputs.
Hope you can help
Hi Andreas, the syntax error checker in Divi is not perfect, it doesn’t recognize all CSS features correctly, but you can be sure that the code is correct – the error messages are false 🤓
Hello,
Thanks for sharing tips.
I tried as described above.
BUT It does not work at all.
I don’t know what I did it wrong.
Please see attached showing what I did.
https://bit.ly/3qJcsYv
The CSS class needs to go to the Menu Module settings – Advanced tab (in the Divi Builder). Sorry I didn’t make it clearer.
Thank you for the answer.
By the way, I see many CSS errors.
https://prnt.sc/26gmqp8
I am not good at css coding.
Can you please write the codes without error?
Thanks.
This CSS code can’t be placed in the Module settings. It can go inside Page settings, Theme Options, or child theme stylesheet (you had it correct the first time, in the Module settings you only need to add the CSS class). The code is correct, trust me 😉
Thank you Ania! It took a little tweaking to make it work right for my site, but I love it! I like to test out all the awesome things you show us how to do for use on my client sites.
Blessed to be on your email list!
Thank you, Diana! I’m very happy to hear it was helpful 🙂
Thanks Ania!
This is great and as always I’m very grateful for your tutorials and freebies! I always get excited when I see a Divi Lover email landing in my inbox.