CKTIS / CSS
CSS property `pointer-events`
`pointer-events` decides whether an element’s boxes participate in pointer hit-testing: `auto` keeps normal targeting, while `none` lets the element underneath become the target.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
auto | nonepointer-events decides whether an element’s boxes participate in pointer hit-testing: auto keeps normal targeting, while none lets the element underneath become the target.
The example overlays a button with a transparent layer using none, so the first point hits the underlying button; a child of that layer with its own auto becomes targetable again, and its event bubbles through the parent.
Grammar: auto | none.
The property is inherited, so a descendant must explicitly set auto to restore hit-testing below a parent using none. Exclusion from hit-testing does not remove an element from sequential focus navigation, and an ancestor listener can still receive an event targeted at an active descendant.
Examples
<!doctype html><meta charset="utf-8"><style>html,body{margin:0}.zone{position:absolute;top:0;width:100px;height:80px}.under{position:absolute;inset:0}.cover{position:absolute;inset:0;pointer-events:none}.cover button{position:absolute;left:20px;top:40px;width:60px;height:30px;pointer-events:auto}</style><div class="zone" style="left:0"><button id="under" class="under">under</button><div id="cover" class="cover"><button id="child">child</button></div></div><pre id="result"></pre><script>let clicked=[],bubbled=0;under.onclick=()=>clicked.push('under');child.onclick=()=>clicked.push('child');cover.addEventListener('click',()=>bubbled++);const hit1=document.elementFromPoint(10,10),hit2=document.elementFromPoint(50,55);hit1.click();hit2.click();const a=getComputedStyle(cover).pointerEvents,b=getComputedStyle(child).pointerEvents;if(hit1.id!=='under'||hit2.id!=='child'||clicked.join('/')!=='under/child'||bubbled!==1||a!=='none'||b!=='auto')throw new Error('pointer hit-test mismatch');result.textContent='hits='+hit1.id+'/'+hit2.id+'; clicks='+clicked.join('/')+'; bubbled='+bubbled+'; computed='+a+'/'+b;</script>Result
hits=under/child; clicks=under/child; bubbled=1; computed=none/auto
The example overlays a button with a transparent layer using `none`, so the first point hits the underlying button; a child of that layer with its own `auto` becomes targetable again, and its event bubbles through the parent.