Divi Tutorials + Layout Kits | WordPress Tips | Business Growth

Home of the Original Divi Tutorials & Divi Layout Kits.

Divi Tutorials + Layout Kits | WordPress Tips | Business Growth

Home of the Original Divi Tutorials & Divi Layout Kits.

This is the fifth in a series on turning your Divi Menu links into buttons and giving them some cool hover effects.

In this tutorial I am going to show you how you can make Divi Menu buttons that have an expanding outline when you mouse over it.

View The Live Demo

Let’s Get Started Making The Divi Menu Buttons With an Expanding Outline

 

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 - OUTLINE]-------------------*/
/*------------------------------------------------*/

	#top-menu li {
		padding-right: 15px;}

	#top-menu > li > a {
		padding: 15px 15px!important;
		margin-bottom: 15px;}

	#top-menu .menu-item-has-children > a:first-child:after {
		display:none;}

	#top-menu-nav > ul > li > a {
		background: #3173b5;
		color: #ffffff;
		-webkit-transform: perspective(1px) translateZ(0);
		transform: perspective(1px) translateZ(0);
		box-shadow: 0 0 1px transparent;
		position: relative;}

	#top-menu-nav > ul > li > a:before {
		content: '';
		position: absolute;
		border: #3173b5 solid 4px;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		-webkit-transition-duration: 0.3s;
		transition-duration: 0.3s;
		-webkit-transition-property: top, right, bottom, left;
		transition-property: top, right, bottom, left;}

	#top-menu-nav > ul > li > a:hover {
		background: #7230b5;}
		
	#top-menu-nav > ul > li > a:hover:before, 
	#top-menu-nav > ul > li > a:focus:before, 
	#top-menu-nav > ul > li > a:active:before {
		border: #7230b5 solid 2px;
		top: -5px;
		right: -5px;
		bottom: -5px;
		left: -5px;}

 

 

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.

expanding outline 1

 

The following rules change the background colors before and after hover and the font color on hover.

 

The following rules change the timing of the animation.

expanding outline 3

 

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.


The following two tabs change content below.
Geno is an entrepreneur who has been designing websites since 1996. He also enjoys all things design, traveling, hanging out with friends, encouraging other believers, and experimenting with new technologies. When not doing any of the above, you can find Geno blogging or writing Divi customization tutorials here on Quiroz.co.

©2012-2019 Geno Quiroz | Teach Learn Build Love | Divi Expert ServicesJohn 3:16

Divi is a registered trademark of Elegant Themes, Inc. This website is not affiliated with nor endorsed by Elegant Themes.

STAY RELEVANT | BE INFORMED | SIGN UP NOW

IT DOES NOT TAKE LONG TO GET LEFT BEHIND!

You have Successfully Subscribed!

Pin It on Pinterest