Forums

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

Home Forums CSS How to keep only parent menu and clicked anchor link menu active

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #245423
    banklan2010
    Participant

    Hello guys
    i’m working on a wordpress project with one of the menus having sub-menus. These sub-menus are anchor links to different sections of the same parent page. My challenge is that when i click on the parent menu, all the sub-menus (obviously the anchor link menus) goes active, which is not what i want. I want it such that when you click one of the sub-menus, only the parent menu and the clicked sub-menu will stay active. I’m working offline on a localhost WAMP.
    Here’s the codepen link. http://codepen.io/banklan2010/pen/xEwOEk
    i will appreciate any assistance please

    #245427
    I.m.learning
    Participant

    From what I can tell, your CSS is targeting all anchors. Maybe create IDs or classes to your specific anchor and style that. Or just play with the object identifyer in the CSS

    #245428
    I.m.learning
    Participant

    I wanted to say something. I was going through the list and just observed you had posted this In a different topic thread.

    Please do not post the same issue more than once. Try to find the most relevant topic and post there. If unsure, put it where you think it should be.

    Know however, some issues never get solved, no matter where it’s placed.

    If you have an issue that had not had a response in a day or 2, then reach out to ask if perhaps the administrators could help.

    Chris Coyer has responded to some posts, he’s pretty good.

    #245433
    Beverleyh
    Participant

    These sub-menus are anchor links to different sections of the same parent page

    Your demo does not contain the markup to reflect this.

    when i click on the parent menu, all the sub-menus (obviously the anchor link menus) goes active, which is not what i want.

    Again, your demo doesn’t illustrate this undesirable behaviour.

    We would need to see a working demo of the undesirable behaviour in order to understand the problem. Only then can we offer suggestions to achieve the desirable behaviour…

    I want it such that when you click one of the sub-menus, only the parent menu and the clicked sub-menu will stay active

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