Tagged: , , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #236625

    Hi,

    I have hover and active effects for the items on the main menu. I would like them to show active, too, while being on their grandchild pages.
    Would you mind helping me with the CSS to assign this?

    This works only for the child pages of the main menu items, but the main menu item is not highlighted active, when I am at a grandchild page:

    .header_color .main_menu ul:first-child > li a:active, .header_color .main_menu ul:first-child > li.current-menu-item > a, .header_color .main_menu ul:first-child > li.current_page_item > a, .header_color .main_menu ul:first-child > li.active-parent-item > a {
        color: #A882BD !important;
    }

    [Note: my site is offline, because it is not yet ready]
    Thanks in advance.

    #237363

    Hi COLORIT!

    Please try this one:

    .header_color .main_menu ul:first-child > li.current-menu-ancestor > a {
    color: #A882BD !important;
    }

    Cheers!
    Ismael

    #237551

    Thank you, but it shows the little line + arrow below the active main menu item, but the word itself is not highlighted.

    I have tried this then:

    .header_color .main_menu ul:first-child > li.current-menu-item > a {
    color: #A882BD !important;
    }

    but this has no effect: the active main menu item is not highlighted, when I’m on a grandchild page of it.

    #237562
    This reply has been marked as private.
    #237787

    Hey!

    Please use this instead:

    .header_color .main_menu ul:first-child > li.current-page-ancestor > a {
    color: red !important;
    }

    This should highlight the ancestor menu item.

    Best regards,
    Ismael

    #237797
    This reply has been marked as private.
    #239237

    Hi!

    You can use the current-page-ancestor class to highlight it:

    
    #header .sub_menu ul:first-child > li.current-page-ancestor > a {
    color: red !important;
    }
    

    Best regards,
    Peter

    #239477

    Thank you very much for your help, works fine now!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Main menu item highlighted, when being on a grandchild page’ is closed to new replies.