Home > Software engineering >  How can I color a <li> or <a> element form a menu when the element is refering to a spec
How can I color a <li> or <a> element form a menu when the element is refering to a spec

Time:12-31

I want a list item to have a specific color when the page is being showed on screen

enter image description here I´m on the "experiencia" page so I want the

  • Experiencia
  • to be colored in other color

  • CodePudding user response:

    I saw your screenshot you are using WordPress CMS. You can use the class current-menu-item for differentiating the active menu item. WordPress is default add it class on active page item.

    Example:

    .current-menu-item a{
      color:red;
    }
    

    CodePudding user response:

    Add this code into your stylesheet, it will work perfectly

    li.current-menu-item > a {
        color: pink !important;
    }

    • Related