Forums

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

Home Forums CSS Menu with heredity problem

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #166639
    Denisotope
    Participant

    Hi,

    I’ve been struggling with this menu problem for days…

    My site: https://phototrope.ca/en

    All menu and sub-menu items behave properly, i.e. stay orange when active.

    .main-navigation .current-menu-item > a,
    .main-navigation .current-menu-ancestor > a,
    .main-navigation .current_page_item > a,
    .main-navigation .current_page_ancestor > a {color: #ff6600;}
    

    Except for “SHOP”.

    Each of its sub-menu items leads to a page showing small photos. It’s when I click on a specific photo that “SHOP” stops being orange.

    If I select SHOP within this context and specify orange:

    li#menu-item-3233.menu-item.menu-item-type-post_type.menu-item-object-page.current-menu-ancestor.current-menu-parent.current_page_parent.current_page_ancestor.menu-item-has-children.menu-item-3233 a {color: #ff6600;}
    

    then all sub-menu items stay also orange even if not active.

    I tried all sorts of ways to fix this heredity problem. To no avail.

    Thank you for your help.

    #166653
    Paulie_D
    Member

    Looks like a WP or JS problem to me but that’s outside my area of expertise.

    #166673
    Denisotope
    Participant

    Thanks Paulie. But I doubt it’s WP or JS related.
    I still believe it’s only a question of using the proper selectors.
    “SHOP” (menu item) is the parent.
    Its sub-menu items are children.
    A particular image within a sub-menu item is a grand-children.

    All I want is to change the parent’s color without affecting its descendance.

    Basic CSS, no?

    #166675
    Paulie_D
    Member

    You can’t affect a parent’s CSS when targeting a child/grandchild element in CSS (yet).

    So you click on an image which is a grandchild you can’t affect the Shop menu.

    Which is why I suspect it’s either a WP/JS issue.

    #166690
    Denisotope
    Participant

    Thanks again Paulie. It might also be related to WooCommerce. This plugin is generating my Shop pages. I will try the WC forum.

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