To Celebrate our launch, you can become a Lifetime member for $199, limited to 100 customers.

Sleeker Divi Mobile Menu

Since Divi was released back in December of 2013 it has had incredible improvements made to the theme and it really has become the go-to theme for a lot of web designers and businesses who have focused on building their own websites using the theme.

But the mobile menu still looks pretty standard and outdated, which is why we feel that it is time to give Divi mobile menu a facelift and make it stand out a bit more instead of looking like an afterthought.

Changing the menu container width:
The Divi Mobile by default is boxed which we are not a fan of, which is why we are going to make our menu full width by adding the following code.

.et_mobile_menu {
border:0px #fff;/*Change this*/
width:125%;
margin-left: -12.5%;
}

Styling the menu items:
Next we want to change how the menu items display on the mobile menu, we are going to make 2 menu items sit side by side by adding the following code.

.et_mobile_menu li a,
.et_mobile_menu .menu-item-has-children > a {
width: 49%;
float: left;
background:#b5b5b5;/*Change this*/
margin-bottom:5px;
margin-right:1%;
color:#fff;/*Change this*/
text-align: center;
}

styling the current page link:
Next we want the current page we are on to stand out from all the other mobile menu items, we are going to this by adding the following code.

#mobile_menu .current_page_item a {
background: #db1c24;/*Change this*/
color: #fff;/*Change this*/
}

Call to action:
Every website should have a clear call to action that you want the user to take and since they are on their mobile device maybe your call to action should be a click to call button, you can make this link do whatever you want it to do.

to make a link that calls click on custom link option and enter this into the URL field tel:01234567810 and then enter what you would like the menu item to say in the next field.

Now let’s add the following code to our CSS

.et_mobile_menu li.menu-item.menu-item-124 a {
width: 99% !important;
background: #8000cf!important;
font-weight: bolder;
text-transform: uppercase;
}

we are going to change the last part of the CSS Class we just added where it say’s .menu-item-124, the specific page CSS class. To do this, we need to open up our browser developer tools by right clicking and selecting inspect element.

Screen Shot 2015-11-30 at 7.24.17 PM

once you’ve opened up your developer tools, look through the HTML until you find your last menu item and click on it, will have a CSS Class for that menu item, now replace that old CSS class with one specific to your website.

Changing opens icon:
Basically, we wanting to change the hamburger icon for an X symbol when the mobile menu is open, the X symbol let the user know to press the X symbol to close the menu.

So let’s add the following to our CSS

/** App Style header and Drop Down Menu **/
.mobile_nav.opened .mobile_menu_bar:before {
content: "4d";
}

Hopefully, your mobile menu will now fresh new look and stand out from the crowd a bit more.

James Fosker

James Fosker

James is the Founder of Fosker Media and Divi Stride, when he not busy working with clients or building tools for the Divi Community he likes to travel and see the world.