Why is the hand cursor not showing in anchor tag when hovered?

Html

Html Problem Overview


I have this markup, a label wrapped in an anchor tag, but the problem is the cursor when you hover this doesn't change to the hand cursor,

<a href="#17">
  <label class="autor">
    <span class="by">
      by 
    </span>
    Erwin Lutzer
  </label>
</a>

what am i doing wrong here?

can anyone plz help, thanks!!

Html Solutions


Solution 1 - Html

The label is cancelling out the pointer, so make sure your CSS has cursor: pointer; for both the a and the label:

a,
a label {
    cursor: pointer;
}

Or better yet, remove the label! It's not valid to have a label inside an anchor.

Solution 2 - Html

Not the answer for actual question, but solution to my own, similar problem:

hand cursor is not showing when hover link. The problem was in the lack of href attribute.

<a>Link</a>  <!-- regular cursor -->

but

<a href="#">Link</a>  <!-- cursor pointer -->

Solution 3 - Html

There's no reason to put a label element in a a element. The label element is here to decorate an input. There's no way for this label to be semantically correct inside a link. As you didn't specify a for attribute linking to an input, there is no reason for it to show the behavior of an activable element.

Reference

Don't use CSS here to add a cursor, this would be semantically incorrect. Replace your label with a span.

Solution 4 - Html

Use this piece of css on your label:

Css code:

label.autor{
cursor:pointer;
}

Solution 5 - Html

As stated by others, it is not valid to put a label inside an anchor tag, but if you really want to do it add the following css code to solve your problem:

a label { cursor: pointer; }

Normally you use a label to point to a specific input field so when you click on the label the input field gets focused. Since you don't reference to an input field the label isn't really useful within the anchor tag.

Solution 6 - Html

After updating my MacBook to High Sierra 10.13.6 I had to restart to get pointer cursors in any browser back to work.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkastuloView Question on Stackoverflow
Solution 1 - HtmlDerek HendersonView Answer on Stackoverflow
Solution 2 - HtmlyurinView Answer on Stackoverflow
Solution 3 - HtmlDenys SéguretView Answer on Stackoverflow
Solution 4 - HtmlC TravelView Answer on Stackoverflow
Solution 5 - HtmlDanielView Answer on Stackoverflow
Solution 6 - HtmlkslstnView Answer on Stackoverflow