Change active menu link color in Wordpress

1.4k views Asked by At

I have this menu (Wordpress/Woocommerce):

enter image description here

I need to know how to change the link of the active page. For example, the Merchandising page.

This is the CSS code for this:

.nav-pills >li > a {
background color: transparent;
color: #fff !important;
}

I tried this:

.nav-pills > li.current-menu-item a {
background color: transparent;
color: #000 !important;
}


.nav-pills > li.current-menu-item>a {
background color: transparent;
color: #000 !important;
}

...With a lot of variations but nothing. I tried with .nav-pills > li.current-menu-item a:active but that change the color only when the link is clicked, not when is the actual page. Any idea how to achieve this? Thank you so much.

1

There are 1 answers

0
Abraham Morales On

Normally WordPress puts you in a class called active to determine that the menu item is the one that is current_page_item, it should work:

.nav-pills > .current_menu_item > a {
   background color: transparent;
   color: #000 !important;
}

If you have the link on the page I could help you more