Stuff you can do with pointer-events

pointer-events is mostly used to bypass click events on an element. But did you know you can reset the pointer events of descendant elements? This allows us to do some interesting things…

(Bootstrap is included in this pen for basic styling)

1. Change styling of a parent on hover

The hover styling of the card is not set unless the button is hovered. Keep in mind this technique disables the ability to open the image-specific context menu when the image is right-clicked (Thanks Šime Vidas for pointing that out ).

100%x180
Card title

Hover the button below to see the effect in action.

2. Change styling of another element

Style the text of the sibling card when the button is hovered.

100%x180
Card 1
100%x180
Card 2

This text changes color if the button in card 1 is hovered.

3. Only make the pseudo element clickable

Only the is clickable. (Doesn't work in Firefox, see this bug .)

4. Only make the path clickable.

pointer-events: visiblePainted can be used to only make the path interactive.

Icon from Font Awesome

That's all folks!

xoxo @Martijn_Cuppens

PS. make sure to check out RFS to control your responsive font sizes.