pointer-events: none;
prevents any action of the mouse pointer (inter) on the specified element (such as clicking, dragging, Hover, etc.). The natural value of pointer-events
is auto
.
Valor inherit
: is not very justified its use. When you specify pointer-events: none;
(or auto
) to one element, all child elements already inherit such value.
Example:
<div style="pointer-events: none;">
<!-- não fez sentido usar inherit no elemento abaixo,
já que ele herda automaticamente o none da div-pai -->
<a href="" style="pointer-events: inherit;">Link</a>
<br />
<p>Texto</p>
</div>
There are other values for pointer-events
, but only apply to SVG (scalable vector graphics):
visiblePainted
visibleFill
visibleStroke
visible
painted
fill
stroke
all
For details of these specifications, you can consult a documentation at MDN.
How to prevent a click on a link/anchor or tied event element
– Sergio
@Sergio and the other combinations? I asked other options that can be used in this property
– Wallace Maxters
One approach that I find interesting in this case is the use of this property together with SVG.
– Woss
Guys, I find it interesting to leave open, since it also covers SVG...
– Wallace Maxters