Change font color of menu item when submenu is selected

  • Author
    Posts
  • #1481763

    Hi,

    I’m using the oxygen theme and want the font color of the main menu item (primary menu on top) to change when one of its sub-menu items is selected (the main menu items stand for different events and I want people to always know which event’s page they’re on when they are eg looking up the dates)

    Is there a CSS code for something like this?

    Thanks!

    The blog I need help with is slambslamp.wordpress.com.

    #1481892

    cristovaov
    Member

    Hello,

    In your custom css option:
    if you add the following bit of code will change the background of your top menu item nicely wrapped around the word and highlight current submenu in addition:

    li[class*="current"] > a {
      background-color: #FFC0CB;
    }

    Hope this helps,

    grtz~

    #1482013

    Hi,

    thanks for the suggestion, works great!

    #1482019

    I’m using a different code now, so just the font color changes (no background color). Thought I would share it here in case anyone who looks up this topic might find it useful:

    .main-navigation ul li a {
    color: #0247b5;
    }

    .main-navigation li[class*=”current”] > a {
    color: #75a9fd;
    }

    .main-navigation ul li a:hover {
    color: #75a9fd;
    }

    .main-navigation ul li a.active,
    .main-navigation ul li a.active:hover {
    color: #75a9fd;
    }

    #1482020

    cristovaov
    Member

    Excellent! thanks~

The topic ‘Change font color of menu item when submenu is selected’ is closed to new replies.