Back to all resources
CSS
pointer-events
interactivity
user interaction

Pointer events

By Jared Malan
This CSS code defines two classes, .pointer-events-off and .pointer-events-on, to control the pointer events of HTML elements. The .pointer-events-off class disables all click and hover interactions by setting the pointer-events property to none. Conversely, the .pointer-events-on class enables all click and hover interactions by setting the pointer-events property to auto. These classes can be applied to HTML elements to dynamically control their interactivity based on user actions or other conditions.