The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events.
Overview tableauto
pointerEvents
pointer-events: all
pointer-events: auto
pointer-events: fill
pointer-events: none
pointer-events: painted
pointer-events: stroke
pointer-events: visible
pointer-events: visibleFill
pointer-events: visiblePainted
pointer-events: visibleStroke
pointer-events
set to some other value.
visibility
property is set to visible and when the pointer is over the interior (i.e., ‘fill’) of the element or the perimeter (i.e., ‘stroke’) of the element, and the fill
, stroke
property is set to a value other than none.
visibility
property is set to visible and when the pointer is over the interior (i.e., fill) of the element.
visibility
property is set to visible and when the pointer is over the perimeter (i.e., stroke) of the element.
visibility
property is set to visible, and the pointer is over the contents, background, or border of the element (or in SVG, over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element).
fill
, stroke
property is set to a value other than none.
The first a element have the pointer-events property set to none, any pointer events (i.e., mouse over, click) do not happen.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Pointer-events example</title>
<link href="pointer-events.css" type="text/css" rel="stylesheet">
</head>
<body>
<p><a href="/docs/" id="one">webplatform.org(none)</a></p>
<p><a href="/docs/" id="two">webplatform.org(all)</a></p>
</body>
</html>
#one{
pointer-events: none;
}
#two{
pointer-events: all;
}
SVG demo of two intersecting circles
{see jsbin for the full source}
Notes
The pointer-events property used to be in the CSS 3 UI specification, but it has been postponed to CSS 4 due to many open issues.
Related specificationsNote: The pointer-events property used to be in the CSS 3 UI specification, but it has been postponed to CSS 4 due to many open issues.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4