We create a number of custom menu hover effects for many of our clients and child themes so I decided it is time to get some of those tutorials into your hands.

In this tutorial I am going to show you how you can make a Divi Menu Bottom Border that expands when you hover over each menu item.

View The Live Demo

*Note: This customization will not work correctly if you have drop down sub-menus. That will require additional modifications not yet available on this tutorial.

Let’s Get Started Making The Expanding Bottom Border

 

Adding The Custom CSS

If you are working with a child theme you can go to Appearance>Editor and open your stylesheet. If not, go to Appearance>Divi Theme Options>Custom CSS (which is located at the bottom of the first tab in Theme Options)

Add this CSS.

/*------------------------------------------------*/
/*------[GQ - MENU EXPANDING BOTTOM BORDER]-------*/
/*------------------------------------------------*/

	#et-top-navigation nav > ul > li > a {
    		padding-bottom: 20px!important;}
	#top-menu-nav > ul > li > a {
		display: inline-block;
		position: relative;
		padding-bottom: 1px;}
	#top-menu-nav > ul > li > a:after {
		content: '';
		display: block;
		margin: auto;
		margin-top:10px;
		height: 2px;
		width: 0px;
		background: transparent;
		transition: width .5s ease, background-color .5s ease;}
	#top-menu-nav > ul > li > a:hover:after, #top-menu li.current-menu-item > a:after {
		width: 100%;
		background: #3173b5;}

 

 

Making Adjustments

Now because there are already so many menu padding options available in the Theme Customizer, there is a good chance you may have to adjust the bottom padding of the main buttons. You can change that here.

divi menu expanding border

 

The following rules change the thickness and the width of the border.

divi menu expanding border

 

The following rule changes the color of the border.

divi menu expanding bottom border

 

And that’s it.

If you used this on one of your projects, please share a link below so we can see how you used it.

Have fun!


Well, that’s all for now. I hope you find this article useful.


STAY RELEVANT | BE INFORMED | SIGN UP NOW

IT DOES NOT TAKE LONG TO GET LEFT BEHIND!

You have Successfully Subscribed!

Pin It on Pinterest