jeudi 15 octobre 2020

Highlighted anchor in nav menu

I have a wordpress system. The problem is my nav menu. I have a link to a subsite in my menu and a anchor point to a part of the main site.
So if I link the anchor like this: #test it works on the main site. If I want to click this on the subsite it dosen't work.

If I link the anchor like this: http://localhost/#test it works on the sub site.

But on the main page the anchor is highlighted. I know that it's because its a current-menu-item, but I don't want it highlighted. I could style the class current-menu-item like the normal color.

But I want that the activ link is highlighted.

My thaughts of the answer was that maybe I link it like this: #test and than I redirct the link to this: http://localhost/#test

But it would be nice if there is another solution. I could not find something about this topic in the www. If anyone have a nice documentation it would be nice.

Thank you for helping me :)




Aucun commentaire:

Enregistrer un commentaire