Answer the question
In order to leave comments, you need to log in
Semantics of the current menu item?
I propose to talk about "metaphysics" - the semantics of html-layout.
Let's assume that a site has a navigation block like this:
<nav>
<li><a href='/cards/'>Карты</a></li>
<li><a href='/money/'>Деньги</a></li>
<li><a href='/two-barrels/'>Два ствола</a></li>
</nav>
<li><b class='active'>Деньги</b></li>
<li><a href='/money/' class='disabled'>Деньги</a></li>
b
, the second one because it leaves the menu item as a working link.
Answer the question
In order to leave comments, you need to log in
The second option is more preferable, and not because the first one is a hack, but because, suddenly, I want to click on the link again? Why clean it up? I just need to show where I am now, but leave all the links in place.
I never thought, I like it when it's like this:
<li><span>Деньги</span></li>
I do like this:
<li class="active">Главная</li>
<li><a href="/products/">Продукты</a></li>
...
You can change like this:
<li><a href='javascript:void(0)' class='active'>Деньги</a></li>
(according to the rules of good manners)
- then, when hovering over this "no longer a link", make a hint, saying [You, sir, are already here]
But something seems to me that this is really from metaphysics and indispensable to reality (except for the active XK page) ... although if many people do this, then users will get used to it.
Remove the tag, it's better to assign class active to the element, and write li.active {} in css.
I don't think onclick in the link is appropriate, because I can follow the link using the keyboard.
Maybe even href="#"?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question