🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEcss

css Documentation

LOADING ENGINE...

CSS pointer-events

Control interactivity. Learn to make elements click-through, manage overlays, and master mouse events.

pointer.css
/* Ghost Overlay */
.overlay {
position: absolute;
pointer-events: none;
}
/* Result: Clicks pass through */
🖱️
pointer.html
1 / 8
🖱️

Tutor:The pointer-events property controls under what circumstances a graphical element can become the target of mouse events.


CSS Interaction Mastery

Unlock nodes by learning how to control element interactivity.

Concept 1: Pointer Basics

The pointer-events property allows you to control whether an element can be the target of pointer events (like clicking, hovering, or dragging).

System Check

What is the default pointer-events value for most HTML elements?


Community Holo-Net

Share Interaction Patterns

Built a cool overlay or custom cursor using pointer-events? Share your snippets.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

CSS Pointer Events

Author

Pascual Vila

CSS Instructor.

The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events (like hovering and clicking).

The none Value

When you set pointer-events: none; on an element, the element is never the target of pointer events. Interestingly, pointer events may target its descendant elements if those descendants have pointer-events set to some other value (like auto).

This creates a "ghost-like" effect where clicks pass right through the element to whatever is underneath it.

Common Use Cases

  • Overlays: Placing a visual gradient or texture over content without blocking the ability to select text or click buttons underneath.
  • Custom Cursors: If you create a custom cursor using a DIV that follows the mouse, you must set pointer-events: none on it so it doesn't block interactions with the page.
  • Disabling Buttons: While disabled attribute is better for HTML forms, pointer-events: none can visually and functionally disable links or other elements.

auto vs none

Use auto (default): When the element should behave normally and respond to clicks, hovers, etc.

Use none: When the element should be ignored by the mouse, allowing interactions to pass through to elements behind it.

Pointer Events Glossary

pointer-events: auto
The element behaves as it normally would (e.g., it can be clicked, hovered, etc.). This is the default value for HTML elements.
pointer-events: none
The element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value.
Pass-through
The ability to interact with an element that is visually "behind" another element, achievable by setting the top element's pointer-events to none.
SVG Values
SVGs have specific pointer-event values like visiblePainted, fill, stroke, allowing fine-grained control over which parts of the vector shape respond to the mouse.