WordPress.org

Ready to get started?Download WordPress

Forums

Spun
[resolved] HIghlight Current Menu Item (8 posts)

  1. elotroalex
    Member
    Posted 1 year ago #

    Hi Caroline (and all),

    I'm now trying to change the opacity and color of the current-menu-item class. I added the following to my style.css in the child theme with no luck:

    }
    .main-navigation li.current_page_item a,
    .main-navigation li.current-menu-item a {
    opacity: 1;
    color: red;
    
    }
    .main-navigation ul li.current_page_item ul a,
    .main-navigation ul li.current-menu-item ul a,
    .main-navigation ul ul li.current_page_item a,
    .main-navigation ul ul li.current-menu-item a {
    opacity: 1;
    color: red;
    
    }

    Any ideas? Here is the website.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try this;

    .main-navigation li.current_page_item a,
    .main-navigation li.current-menu-item a {
     color: red;
    }

    Are you using a browser developer tool like the one built in to Google Chrome to explore this?
    http://developers.google.com/chrome-developer-tools/docs/elements

  3. elotroalex
    Member
    Posted 1 year ago #

    I am using Chrome developer tools, yes.

    The solution didn't work. It's really weird because Chrome shows me that the CSS rules are active. Even when I tweak them at the item level using Chrome, nothing happens. In theory, even this should work:

    .current-menu-item {
     color: red;
    }
  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    You may need to clear your browser's cache if you want to see immediate CSS changes on the webpage.

  5. elotroalex
    Member
    Posted 1 year ago #

    It worked. It was the cache. As soon as I tried it on Firefox I realized. Do you know what I was doing wrong? Why wasn't it selecting?

  6. elotroalex
    Member
    Posted 1 year ago #

    Hmm. The opacity doesn't work. Interesting. I guess it inherits it from the group.

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Do you know what I was doing wrong? Why wasn't it selecting?

    Not sure, sorry.

  8. elotroalex
    Member
    Posted 1 year ago #

    Thanks for your help, Andrew. There seems to be some kind of weird inheritance issue. I'm now experiencing it trying to do some padding tweaks on a regular .page .hentry.

    Fighting on!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic