Site logo

Archived topic

Not background color in secondary menu

1 reply · Started by Fernando Díaz Gascón on January 29, 2022

Viewing posts 1–2 of 2

Hello,
In order to get a main menu element highlighted (with background color), I used this code probably you gave me here:

.main-navigation .main-nav ul li.nav-button a {
color:white;
background-color: #d80025;
border: 2px solid #d80025;
border-radius:10px;
}
.main-navigation .main-nav ul li.nav-button a:hover {
color: #d80025;
background-color:white;
}

The problem is that it affects also the sub-menu elements (the elements below the main menu element). I dont want to affect the sub-menu elements. How can I do?

Thank you very much.

Hi there,

change this lineL

.main-navigation .main-nav ul li.nav-button a {

to:

.main-navigation .main-nav ul li.nav-button > a {

And this line:

.main-navigation .main-nav ul li.nav-button a:hover {

to:

.main-navigation .main-nav ul li.nav-button:hover > a {

This archived topic is closed to new replies.