2018-10-12 19:37:13 +00:00
|
|
|
---
|
|
|
|
title: Pointer Events
|
|
|
|
---
|
|
|
|
## Pointer Events
|
|
|
|
|
2018-11-05 20:49:14 +00:00
|
|
|
The `pointer-events` property determines if an element will react to pointer events.
|
|
|
|
|
|
|
|
There are 4 possible values that can be assigned to the `pointer-events` property:
|
|
|
|
- `auto` Default Setting: Reacts to `pointer events` like :hover or click.
|
|
|
|
- `none` Sets that the element won't react to `pointer-events`
|
|
|
|
- `initial` Uses the default value
|
|
|
|
- `inherit` Inherits from parent
|
|
|
|
|
2018-11-01 05:51:41 +00:00
|
|
|
This property specifies how your mouse reacts when you hover over any element on a page.
|
2018-10-12 19:37:13 +00:00
|
|
|
|
2018-11-01 05:51:41 +00:00
|
|
|
### Example
|
|
|
|
|
|
|
|
```css
|
|
|
|
|
|
|
|
.example {
|
|
|
|
pointer-events: auto;
|
|
|
|
/*this will use the default look set by the browser agent*/
|
|
|
|
}
|
|
|
|
|
|
|
|
.example {
|
|
|
|
pointer-events: none;
|
|
|
|
/*this will use the regular mouse look when hovered over the element*/
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### Other acceptable values
|
|
|
|
|
|
|
|
Other values could be: `initial`, and `inherit`
|
2018-10-12 19:37:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
#### More Information:
|
|
|
|
- [pointer-events on MDN web docs](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events)
|
|
|
|
- [Scalable Vector Graphics 1.1 specification (recommendation)](https://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty)
|
|
|
|
- [Can I use: CSS pointer-events property](https://caniuse.com/#feat=pointer-events)
|
2018-11-05 20:49:14 +00:00
|
|
|
- [W3schools - CSS pointer-events Property](https://www.w3schools.com/cssref/css3_pr_pointer-events.asp)
|