Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pointer-events:none prevents title attribute

Tags:

html

css

I am having an anchor tag, which should not be clicked so i have added pointer events none.i have a title attribute on the anchor tag need to be shown while hovering. pointer-event:none prevents the title tag from showing up.Is there a way to have both pointer-events:none and title showing up.

a{
  pointer-events:none;
}
<a href="https://stackoverflow.com/" title="Some Sample Title"> Sample Link </a>
like image 970
yasarui Avatar asked Nov 21 '17 11:11

yasarui


1 Answers

No, pointer-events: none is pretty encompassing in that any eventType that is associated with the mouse. You could wrap a <span> around the anchor and assign the title to that instead. It's ugly but valid.

Demo

a {
  pointer-events: none;
}
<span title='I am wrapped around this anchor'>
<a href="https://stackoverflow.com/" title="Some Sample Title">Sample Link</a>
</span>
like image 89
zer00ne Avatar answered Nov 15 '22 20:11

zer00ne