Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [wordpress] parent menu highlight when in sub-menu page

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45958
    noodle
    Member

    Hi,

    I’m trying to get a child page to highlight it’s parent in a main menu. The link is below.
    What I’m trying to achieve is when you click on the parent menu link it goes straight to it’s sub-menu option 1. If you then go to sub-menu option 2, the parent link should still be highlighted.

    I’ve tried using

    .current-page-ancestor a {
    color: black;
    }

    with no luck.

    http://tinyurl.com/o22cyep

    Hopefully this makes sense. Does anyone know how I can achieve this?

    Thanks in advance.

    #140947
    jurotek
    Participant

    In your css you have

    .menu a {bunch of styles}

    Add this

    .menu a.active, .menu a.active:hover {
    color:#000;
    }

    Add

    class=”active”

    to your anchor on every page you want your text in parent navigation to be black

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.