CSS pointer-events Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Interaction

What You’ll Learn

The pointer-events property controls whether an element can receive mouse clicks, touch taps, and hover events. It is especially useful for overlays, disabled-looking UI, and SVG hit areas.

01

auto

Default behavior.

02

none

Ignore clicks.

03

Overlays

Click-through layers.

04

Blocking

Loading shields.

05

SVG

Hit testing.

06

a11y

Use wisely.

Introduction

The pointer-events property in CSS is used to control whether an element can be the target of pointer events, such as mouse clicks, touch events, or cursor hovers.

This property is particularly useful for creating interactive web elements and managing user interactions on your webpage.

Definition and Usage

On everyday HTML pages, you will mostly use auto and none. Set pointer-events: none when an element should look present but not capture clicks, such as a decorative label over an image link.

SVG graphics support additional values that control which painted parts of a shape can receive pointer input. That helps you keep decorative strokes visible while limiting clicks to the useful area.

💡
Beginner Tip

pointer-events: none does not remove an element from the page. It only changes which element the browser treats as the click target underneath the pointer.

📝 Syntax

The syntax for the pointer-events property is simple and can be applied to any HTML element.

syntax.css
element {
  pointer-events: value;
}

Here, value can be one of the predefined keywords that determine the behavior of pointer events for the element.

Basic Example

pointer-events-none.css
button {
  pointer-events: none;
}

Syntax Rules

  • auto restores normal pointer interaction.
  • none makes the element transparent to pointer hit testing.
  • Events can reach elements below when the top layer uses none.
  • Pair visual disabled styles with the right HTML attribute when needed.
  • SVG supports extra values for fill, stroke, and visibility rules.
  • Test touch devices when building overlays and modals.

🎯 Default Value

The default value of the pointer-events property is auto, which means that the element can be the target of pointer events as usual.

⚡ Quick Reference

QuestionAnswer
Default valueauto
Most common overridenone
Applies toAll elements
InheritedYes
AnimatableNo
Common useClick-through overlays and non-interactive decorations

💎 Property Values

For HTML, focus on auto and none. SVG content can use the additional paint and visibility keywords below.

ValueExampleDescription
autopointer-events: auto;The element behaves as it would if the property were not specified. It can be the target of pointer events.
nonepointer-events: none;The element is never the target of pointer events. All pointer events will be ignored for this element.
visiblePaintedpointer-events: visiblePainted;SVG: events only when the element is visible and painted. Default for SVG content.
visibleFillpointer-events: visibleFill;SVG: events when the fill is visible.
visibleStrokepointer-events: visibleStroke;SVG: events when the stroke is visible.
visiblepointer-events: visible;SVG: events when visible, for fill and/or stroke.
paintedpointer-events: painted;SVG: events when painted, regardless of visibility.
fillpointer-events: fill;SVG: events when the fill is painted.
strokepointer-events: stroke;SVG: events when the stroke is painted.
allpointer-events: all;SVG: events regardless of visibility or paint status.
auto none visiblePainted fill stroke

When Does pointer-events Matter?

pointer-events is the right tool when pointer input should be redirected or blocked:

  • Decorative overlays — Let clicks pass through labels sitting on top of links or cards.
  • Loading shields — Block interaction with a panel while data loads.
  • Disabled-looking UI — Stop clicks on controls that are not yet available.
  • SVG graphics — Limit hit areas to fills or ignore wide decorative strokes.

For true form disabling and accessibility, combine CSS with the correct HTML attributes and ARIA patterns.

👀 Live Preview

The grey button uses pointer-events: none, so it cannot be clicked. The blue button uses the default auto behavior.

pointer-events: auto

pointer-events: none

A pass-through overlay sits on top visually but does not steal clicks from the content below.

Examples Gallery

Start with the reference disabled button, build a click-through overlay, toggle a blocking shield, and refine SVG hit areas.

🖱 HTML Interaction

Use pointer-events on everyday HTML elements — matching the reference example.

Example 1 — Disabled Button

In this example, we’ll disable pointer events for a button.

pointer-events-button.html
<style>
  button {
    pointer-events: none;
    background-color: grey;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
  }
</style>

<h1>Button with Disabled Pointer Events</h1>
<button>Click Me</button>
<p>The button above cannot be clicked because pointer events are disabled.</p>
Try It Yourself

How It Works

The button still appears on the page, but the browser skips it during hit testing, so click handlers never run.

Example 2 — Click-Through Overlay

Place a label over an image link with pointer-events: none so users can still click the link underneath.

pointer-events-overlay.html
<style>
  .overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
</style>
Try It Yourself

How It Works

Hit testing ignores the overlay layer, so the interactive element beneath receives the click or tap.

🔀 Layers & SVG

Block interaction temporarily or limit SVG hit areas with precise values.

Example 3 — Blocking Shield

Toggle a shield between pointer-events: auto and none to block or allow clicks on a panel.

pointer-events-shield.html
<style>
  .shield.blocking {
    pointer-events: auto;
  }

  .shield.pass-through {
    pointer-events: none;
  }
</style>
Try It Yourself

How It Works

Loading states and modal backdrops often need a full-area layer that captures or releases pointer input on demand.

Example 4 — SVG Hit Areas

Set pointer-events: none on a decorative stroke so only the filled rectangle receives clicks.

pointer-events-svg.html
<style>
  .decoration {
    pointer-events: none;
  }
</style>

<svg viewBox="0 0 400 200">
  <rect class="hit" x="40" y="40" width="320" height="120"/>
  <path class="decoration" d="M 20 180 Q 200 20 380 180"/>
</svg>
Try It Yourself

How It Works

SVG shapes can have large painted areas. pointer-events lets you keep visuals rich while limiting interaction to the shapes that matter.

pointer-events vs cursor and opacity

pointer-events: none stops hit testing, but the element can still look clickable if cursor: pointer remains. Update cursor styles together with pointer rules.

opacity can make content look faded, and pairing it with pointer-events: none is a common disabled-state pattern. Remember that visibility: hidden also affects interaction differently.

disabled-look.css
.is-unavailable {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

🧠 How pointer-events Works

1

User moves the pointer

A click, tap, or hover starts browser hit testing at the pointer location.

Pointer input
2

Browser checks each layer

Elements with pointer-events: none are skipped in the hit test.

Hit testing
3

The target receives the event

The top eligible element gets the click or hover, or the event reaches the layer below.

Event target
=

Controlled interaction

You decide which visible layers actually participate in pointer interaction.

Browser Compatibility

The pointer-events property is supported in all modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

HTML · SVG · Modern support

Reliable pointer-events support

Chrome, Firefox, Safari, Edge, and Opera support auto and none on HTML elements.

98% Modern browser support
Google Chrome 2+ · Desktop & Mobile
Full support
Mozilla Firefox 3.6+ · Desktop & Mobile
Full support
Apple Safari 4+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 9.5+ · Modern versions
Full support

Testing tip

Test overlays on touch screens. A pass-through label should not block taps on the link or button underneath.

pointer-events property 98% supported

Bottom line: pointer-events is widely supported for HTML and SVG in modern browsers.

Conclusion

The pointer-events property is a versatile tool for managing user interactions with web elements.

By using this property, you can control whether an element responds to pointer events, which is useful for creating custom interactions and enhancing user experience. Experiment with different values to see how this property can improve the interactivity of your web projects.

💡 Best Practices

✅ Do

  • Use pointer-events: none on decorative overlays above links
  • Pair visual disabled styles with the correct HTML attributes when needed
  • Update cursor when interaction changes
  • Test click-through behavior on mobile touch devices
  • Use SVG values to limit hit areas on complex graphics

❌ Don’t

  • Rely on pointer-events: none alone for form accessibility
  • Hide important controls only with CSS when users still need access
  • Forget that inherited none affects child hit testing context
  • Assume keyboard focus is blocked the same way as mouse clicks
  • Block entire pages without clear loading or disabled feedback

Key Takeaways

Knowledge Unlocked

Five things to remember about pointer-events

Use these points when controlling clicks, taps, and hovers.

5
Core concepts
02

none

Ignore pointer.

Pattern
03

Overlays

Click-through.

Use case
04

SVG

Hit testing.

Context
🔒 05

a11y

Use with care.

Reminder

❓ Frequently Asked Questions

pointer-events controls whether an element can be the target of pointer interactions such as clicks, taps, and hovers. With pointer-events: none, the element ignores those events and they can pass through to elements below.
The default value is auto, which means the element behaves normally and can receive pointer events.
pointer-events: none only stops interaction. It does not change form validation, focus order, or accessibility semantics. For real form controls, use the disabled attribute when appropriate.
Yes. The element is skipped in hit testing, so the browser can target the element underneath, which is useful for decorative overlays.
pointer-events mainly affects pointer input. Keyboard focus behavior depends on the element type and other properties. Do not rely on pointer-events alone for full accessibility control.

Practice in the Live Editor

Open the HTML editor and experiment with pointer-events: none on overlays and buttons.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful