Archived topic
menu button
9 replies · Started by Jose on November 26, 2020
Hi, I have created a buttton in the menu, but when I am in the page of that button, it changes its color, how can i fix it?
http://luisentr-cp505.wordpresstemporal.com/
"REGALA SALUD"
Regards,
Hi there,
in your CSS change this:
.main-navigation .main-nav ul li.nav-button a {
background-color: #ff1e00;
border: 2px solid #ff1e00;
border-radius: 40px;
color: #ffffff !important;
line-height: 35px;
}
to:
.main-navigation .main-nav ul li.nav-button a,
.header-wrap #site-navigation:not(.toggled) .main-nav>ul>li.nav-button[class*="current-menu-"]>a {
background-color: #ff1e00;
border: 2px solid #ff1e00;
border-radius: 40px;
color: #ffffff !important;
line-height: 35px;
}
But with that code I hace the button effect in all the pages i am.
Edited the CSS above - try that
Okey, it is workin now. But when I hover over the button, backgroung anc color text are white, in my CSS I have it different, do you know what the problem can be?
Regards,
Try adding this:
.main-navigation .main-nav ul li.nav-button:hover a {
color: #ff1e00 !important;
}
BTW - this method may be worth looking into when it comes to adding buttons to the navigation: https://docs.generatepress.com/article/generate_menu_bar_items/
Nothing...
I'm not seeing Tom's CSS being added.
When tested the code, it worked as expected:
https://www.screencast.com/t/oQkbYjOG
Now it is working, but it is strange, I have to write the code twice...
It is weird
You shouldn't have to write the same code twice.
Glad it's working though.