Willy David Jr Willy David Jr - 1 month ago 10
HTML Question

Disable Link Using CSS but Enable Title

HTML:



.disabledLink {
pointer-events: none;
opacity: 0.6;
cursor: default;
}

<a href="www.google.com" class="disableLink" title="My Title" />
<span datahover="test">My Link</span>
</a>





Unfortunately, title is not appearing when hovering my mouse to the link. Is there a better way to enable title?

Answer

.disabled-link {
  pointer-events: none;
}
<span datahover="test" title="My Title"><a href="www.google.com" class="disabled-link">My Link</a></span>

Change your markup into this. It will work. Instead of targeting tag. I target the span for title. Hope it helps.

Comments