[Resolved] Problems with HTML Anchors within the navigation and the "current page" color

Home Forums Support [Resolved] Problems with HTML Anchors within the navigation and the "current page" color

Home Forums Support Problems with HTML Anchors within the navigation and the "current page" color

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1236041
    Marcel Kuhla

    Hello,

    I’m currently working on our new company homepage and now I have the following problem:

    I have created an Element for a full-size page header and some text and some call-to-action buttons etc. Now I used Gutenberg with some blocks to model the general front page and I have anchored some blocks like lastest news, team or partners.

    But when I add the links for these anchors to my navigation, all links with /#anchor will be highlighted. For now, I have disabled that custom color, but there must be a way to use it?

    Regards,

    Marcel

    #1236647
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can show us an example? I’m not able to picture it.

    I tried going to your URL but it’s a 404.

    Let me know πŸ™‚

    #1237088
    Marcel Kuhla

    Hello Tom,

    here you can see it. All menu points are HTML anchor links “/#team” “/#partner” etc. The main menu color is set to #fff and the current page color is set to #ffd047.

    anchor-bug

    Regards,

    Marcel

    #1237590
    Tom
    Lead Developer
    Lead Developer

    So all of the menu items are using the current color?

    That’s because they’re all pointing to the current page, so WordPress adds the current-menu-item class to them.

    You could disable the current menu item color from this page with CSS, and then only target :active selector.

    If you’d like to link me to the page I should be able to help more.

    #1237692
    Marcel Kuhla

    Hello Tom,

    I can’t because the site isn’t available online currently. But I disabled the color on current-menu-item and used page-item as an anchor and gave it the right color.

    It’s a bit hacky, but it works (for now).

    Thanks for getting me on the right track πŸ™‚

    Regards,
    Marcel

    #1237982
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.