Summary
The CSS property pointer-events allows authors to control whether or when an element may be the target of a mouse event. This property is used to specify under which circumstance (if any) a mouse event should go “through” an element and target whatever is “underneath” that element instead.
- Initial value : auto
- Applies to: all elements
- Inherited : yes
- Media: visual
- Computed value : the specified value, or else the inherited value
Syntax
pointer-events: auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit
Values
Note: as of Firefox 3.6, only the values auto and none apply to all elements. The other values only apply to SVG and behave like auto in other XML and HTML content.
- auto
- The element behaves as it would if thepointer-eventsproperty was not specified. In SVG content this value and the valuevisiblePaintedhave the same effect.
- none
- The element is never the target of mouse events, although mouse events may target its descendant elements if those descendants havepointer-eventsset to some other value, in which case mouse events will trigger event listeners on this element as appropriate on their way to/from the descendant during the event capture/bubble phases.
- visiblePainted
- SVG only. The element can only be the target of a mouse event when thevisibilityproperty is set tovisibleand when the mouse cursor is over the interior (i.e., ‘fill’) of the element and thefillproperty is set to a value other thannone, or when the mouse cursor is over the perimeter (i.e., ‘stroke’) of the element and thestrokeproperty is set to a value other thannone.
- visibleFill
- SVG only. The element can only be the target of a mouse event when thevisibilityproperty is set tovisibleand when the mouse cursor is over the interior (i.e., fill) of the element. The value of thefillproperty does not effect event processing.
- visibleStroke
- SVG only. The element can only be the target of a mouse event when thevisibilityproperty is set tovisibleand when the mouse cursor is over the perimeter (i.e., stroke) of the element. The value of thestrokeproperty does not effect event processing.
- visible
- SVG only. The element can be the target of a mouse event when thevisibilityproperty is set tovisibleand the mouse cursor is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of thefillandstrokedo not effect event processing.
- painted
- SVG only. The element can only be the target of a mouse event when the mouse cursor is over the interior (i.e., ‘fill’) of the element and thefillproperty is set to a value other thannone, or when the mouse cursor is over the perimeter (i.e., ‘stroke’) of the element and thestrokeproperty is set to a value other thannone. The value of thevisibilityproperty does not effect event processing.
- fill
- SVG only. The element can only be the target of a mouse event when the pointer is over the interior (i.e., fill) of the element. The values of thefillandvisibilityproperties do not effect event processing.
- stroke
- SVG only. The element can only be the target of a mouse event when the pointer is over the perimeter (i.e., stroke) of the element. The values of thestrokeandvisibilityproperties do not effect event processing.
- all
- SVG only. The element can only be the target of a mouse event when the pointer is over the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of thefill,strokeandvisibilityproperties do not effect event processing.