Adding Icons To Your Divi Menu
Another Divi Menu Tutorial
At this point we have quite a lot of Divi menu tutorials, and I know many of you are thrilled about that. We still have more in our series on the Menu module, but the cool part about the tutorial today is that we made the code work with both the default Divi menu and the Menu module. I have been wanting to show you how to add icons to the Divi menu, and I’m finally get to it!
Icons are a nice way to add a lot of interest to your menu. The right icon will give the use that sublte indication of what the link is about, but they also look really. I’ll also throw in a bonus at the end and show you how to achieve a cool hover effect!
Add Icons To The Divi Main Menu Links
The first snippet here will apply to the top-level menu items. Again, this will work with the default Divi module or it will work in the Theme Builder or anywhere else using the Menu module. After we copy and paste the code, we can talk more about customizing it like replacing the icon or colors.
If you are not sure where to add the code, check out our tutorial called Where To Add Custom Code In Divi. The short answer is to copy the code snippet and add it in Divi>Theme Options>Custom CSS box.
/*add icon to Divi main menu items*/
.nav li a:before {
font-family: 'ETMODULES';
content: '\24';
text-align: center;
vertical-align: middle;
margin-right: 10px;
margin-left: -10px;
color: #2cba6c;
font-size: 1em;
transition: all .3s ease;
}
Add Icons To The Divi Menu Submenu Dropdown Links
This second snippet applies the icon to the submu links. So this will add an icon to the Divi menu dropdown items in the Menu module or in the default menu. The same process applies here, just copy the code and paste it in the Divi>Theme Options>Custom CSS box.
/*add icon to Divi submenu items*/
.nav li li a:before {
font-family: 'ETMODULES';
content: '\24';
text-align: center;
vertical-align: middle;
margin-right: 10px;
margin-left: -10px;
color: #2cba6c;
font-size: 1em;
transition: all .3s ease;
}
Different Icons For Different Menu Links
So far, the snippets above would apply the same icon to all the main menu or submenu links. That might be fine for you, and it works great on my site, but you can also set a different icon for each of the menu items. All we have to do is add a new CSS class for each menu item.
Here’s an example of adding a custom class to a menu item.

And here is how we would target that menu item. We want to add a cart icon, so we add “e015” to the CSS snippet (see step below for more information about this).
.pa-menu-shop > a:before {
font-family: 'ETMODULES';
content: '\e015';
text-align: center;
vertical-align: middle;
margin-right: 10px;
margin-left: -10px;
color: #2cba6c;
font-size: 1em;
transition: all .3s ease;
}
Here is how that would look:

Now you can go ahead and repeat this for any icon next to any menu item!
Choosing The Icons For The Divi Menu
The obvious step here is to replace the icon (or keep the arrow if you like it). Here is where you get to choose an icon from either the built-in Divi ETModules icon font family or the Font Awesome icon font family.
There are several great choices for icons to add to your Divi menu Module. I’m going to talk about two in this tutorial, since the one set is built-in to Divi and the other is easily integrated.
1. ETModules
The first set of icons you can use are the one that come built-in to Divi by default and require no other steps to activate. All you have to do is choose an icon and then add that to the CSS snippet that I will give. You can learn more about these icons on the Elegant Themes blog post here. You will need to reference this to get the icon codes.
In the code snippets, we already have “font-family: ‘ETMODULES’;” as the font family, so if you any of these icons you won’t have to change anything.
You can choose any icon you want.

This is just screenshot of some of the icons available. The part that can be confusing here is the icon code. You don’t actually need the first part of the code, so you can disregard the &#x part of it. So for the fourth one here you can see we only used “24” to get the arrow.
2. Font Awesome
The second set of icons you can use is Font Awesome. If you already have Font Awesome integrated with your website then you are good to go. Otherwise, check out our tutorial on How To Add Font Awesome To Divi.
To use a Font Awesome icon, you will need to replace the font family in the snippets. But don’t worry, it’s very easy. Just change the “ETModules” to “Font Awesome 5 Free.”
The next line in the CSS is the icon code. You can replace the “24” with the icon code from Font Awesome. Simply go search their icon library and click on an icon. Then, copy the Unicode as shown in the image below.

In this example, the icon Unicode is “f102,” so all we have to do is add this to the CSS snippet like “content: “\f102″;” and the icon will appear.
Adding Cool Hover Effects To The Divi Menu Icons
Now that we have pasted the snippets into our website and selected the icons, let’s customize the icons a little. On our site here, we have two things happen when you hover over the submenu items. The icon changes color, and the icon and link move to the right. Here’s a snippet you can add to achieve this:
/*change color and position of submenu icon on hover*/
.nav li ul li a:hover:before {
margin-left: -7px;
color: #e03574 !important;
transition: all .3s ease;
}
One more question,would you let me know how to add a custom icon on the submenu?
Hi Jeremy,
That is what this tutorial is about 🙂
What CSS would I use to add an icon to the right of a fullscreen menu item on hover?
This worked great on my header navigation menu! Just what I was looking for because I wanted the icons next to the link to respond the same way as the link (hover, and clicking)… BUT I can’t get it to work on the mobile drop down menu… tried messing around with the code in every way possible… either I can get the icon to respond with the link BUT the customizations for the appearance of the icon are gone/not being used. OR the old way where the icon appearance is customized but the icon isn’t clickable or it doesn’t have… Read more »
Nevermind… finally figured this out with the select element… works! Thanks for this post… literally spent 2 days finding how to make the pseudo element a part of the parent element so you can click on it and make the hover respond the same way and all I needed was to add the letter ‘a’ in front of :before … this was the only article that event mentioned this
Hi Streater,
So glad to hear you got it sorted out! I am happy you are finding and enjoying the content here on my blog! 🙂