pointer-events

Stops an element from reacting to clicks and hovering.

Initial value
auto
Inherited
Yes
Animatable
no
Applies to
all elements
JavaScript
element.style.pointerEvents = "none"
On this page

Example

#
CSS
.glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(167, 139, 250, 0.3), transparent 60%);
  pointer-events: none;
}
Preview

Definition and usage

#

The pointer-events: none property makes an element “transparent” to mouse and touch. Clicks pass through it to the elements underneath, and :hover styles stop working.

It is most often used for decorative overlays, gradients, and glows that sit above content but shouldn’t block clicking the links beneath them.

Note: pointer-events: none does not disable keyboard handling. A button with this property can still be focused with the Tab key and activated with Enter, so use the disabled attribute to block actions.

Syntax

#
Syntax
pointer-events: auto | none;

Values

#
  • auto

    The overlay captures clicks, the button beneath it doesn’t work.
  • none

    Clicks pass through the overlay to the button.

Values in practice

#

auto

The overlay captures clicks, the button beneath it doesn’t work.
.demo { pointer-events: auto; }

none

Clicks pass through the overlay to the button.
.demo { pointer-events: none; }

Browser support

#

Widely available

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • Always mark decorative layers above content with pointer-events: none, otherwise they will block clicking.
  • Use disabled to turn buttons off, not pointer-events: none alone, because the keyboard will still work.

Related entries

#

Practise it in lessons

#

Spotted a mistake or missing an example? Write to us.