Archived topic
Adding buttons to nav, sticky nav and off-canvas panel
5 replies · Started by Stephen on May 26, 2021
Hi Support,
I hope you are all well. I have added a 'contact' button to the primary nav and off canvas menu for desktop and mobile on my website - http://www.cleardesign.studio.
I am really happy with how it looks apart from when you scroll down the page on desktop. The button expands when the sticky nav comes into play.
Please let me know how it can be sorted! Thanks!
@media {
.main-navigation .main-nav ul li.nav-button a {
background-color: #f5f5f5;
border: 2px solid #1b306c;
color: #1b306c;
line-height: 35px;
}
}
.main-navigation .main-nav ul li.nav-button:hover a {
background-color: #1b306c;
color: #ffffff;
transition: 0.5s;
}
}
@media (max-width: 1024px) {
.slideout-navigation .main-nav ul li.nav-button a {
background-color: #f5f5f5;
border: 2px solid #1b306c;
color: #1b306c;
margin-top: 20px;
line-height: 50px;
}
}
.slideout-navigation .main-nav ul li.nav-button:hover a {
background-color: #1b306c;
color: #ffffff;
transition: 0.5s;
}
}
Hi there,
Edit:
line-height: 35px;
to this
line-height: 35px !important
Let me know if this helps :)
Spot on, cheers! That solved it.
I'm also wondering if there is some code that would allow me to use the underline menu (from this article: https://generatepress.com/forums/topic/underline-menu-navigation-on-hover-and-current/) but excluding the contact button that I've added? I tried adding this CSS and it looks great but I just don't want the underline transition to appear on the new button I've added.
Many thanks!
You can try change this selector .menu-item to .menu-item:not(.nav-button)
Let me know :)
Thanks, that worked!
Great!
You are welcome :)