How to Let Clicks Pass Through to the Element Below with CSS pointer-events
Adding pointer-events: none to an overlaid element lets clicks pass straight through it to the button or link underneath. Use it when a watermark over an image or card, a gradient shadow, or a full-screen notification layer (toast) stops the button below from being clicked. Hover and mouse wheel events also reach the element below. Adding pointer-events: auto to a child lets you click only that child.
The test environment was Ubuntu 24.04, Node.js 22.23.4, Playwright 1.63.0, and headless Chromium 153. I opened a test page with Playwright, sent clicks, hovers, and wheel events with page.mouse, and recorded which element's event listener fired. I did not test Firefox, Safari, or touch input. I also do not cover SVG-only values such as visiblePainted.
Set pointer-events: none on the overlaid element
I placed a layer with diagonal stripes over the entire card, which contains a button, using position: absolute. Then I clicked the center of the button.
.card {
position: relative;
}
.layer {
position: absolute;
inset: 0;
pointer-events: none; /* Let clicks pass through to the elements below */
}

Without the setting, the click went to the overlay, and the button's click count stayed at 0. When I added pointer-events: none to the layer, the same click fired the button's click event, and the count went to 1.
I also tested a page where a gradient layer, transparent to white, covered the entire button. You can find which element receives a click by calling document.elementFromPoint() with the button's center coordinates. Without the setting, the overlay was returned. With pointer-events: none, the button was returned. This is useful for finding out what is covering an element when it cannot be clicked.
The MDN page for pointer-events explains that an element with none is not a target for pointer events, and that events pass through it to the element below.
Hover and mouse wheel also reach the element below
pointer-events: none does more than pass clicks through. On the same gradient page, I gave the button a :hover style that changes its background color. When I moved the mouse over the button through the layer, the background did not change without the setting, but it changed to the :hover color with pointer-events: none on the layer.
Mouse wheel events behaved the same way. I placed a gradient shadow as a sibling element at the bottom edge of a box that scrolls with overflow: auto, then rotated the wheel by 100px over the shadow. Without the setting, the box did not move (scrollTop stayed at 0). With pointer-events: none on the shadow, the box scrolled by 100px. When you place decoration over a scrollable box, add this setting so that scrolling still works, not only clicks.
Making only a child clickable
To show a notification in the bottom-right corner of the screen, you can create a position: fixed layer that covers the whole screen. Add pointer-events: none to the layer, then add pointer-events: auto to the notification. Outside the notification you can still operate the page below, and the buttons inside the notification remain clickable.
.toast-layer {
position: fixed;
inset: 0;
pointer-events: none;
}
.toast {
position: absolute;
right: 16px;
bottom: 16px;
pointer-events: auto; /* Make only the notification clickable */
}
Here are the results from this page:
| Position clicked | Element that received the click |
|---|---|
| A button on the page below the layer | The button on the page |
| A child inside the layer with no setting (text) | The body below, since the click passed through the child |
| The "Close" button inside the notification | The "Close" button |
| Text inside the notification | The text element inside the notification |
pointer-events is an inherited property (CSS Basic User Interface Module Level 4 specification). A child inside the layer with no setting computed to none, so clicks passed through it too. When I added auto to the notification element, the computed value of the "Close" button inside it became auto. To make a part of the page clickable, add auto to its outermost element, and the children inherit it.
The click listener on a layer with pointer-events: none does not stop working entirely. A click listener I attached to the layer fired when I clicked the "Close" button or the text inside the notification, and event.target was the child that was clicked. This is because the child's click event bubbles up to the layer.
The MDN page and the specification also say that if a descendant of a none element has a value such as auto, that descendant becomes a target for events, and the events reach listeners on the none ancestor through capture and bubbling. In my test, however, clicking inside the layer but outside the notification did not fire the layer's listener. The click passed through the layer and reached the body below.
Keyboard operation still works
Adding pointer-events: none does not stop keyboard operation. I tested a link with href="#done" that had pointer-events: none.
- Clicking with the mouse left
location.hashempty, and the page did not navigate to the link target. - Pressing the Tab key moved focus to the link.
- Pressing Enter then set
location.hashto#done, and the page navigated to the link target.
The MDN page and the specification also say that an element with pointer-events: none does not stop focus from moving with the Tab key.
To make a button that cannot be clicked, use the HTML disabled attribute instead of pointer-events: none. A disabled button did not fire its click listener when I clicked it with the mouse. When I pressed the Tab key, focus skipped that button and moved to the next one.




