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)
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 ).
Hover the button below to see the effect in action.
Style the text of the sibling card when the button is hovered.
This text changes color if the button in card 1 is hovered.
Only the ✗ is clickable. (Doesn't work in Firefox, see this bug .)
pointer-events: visiblePainted
can be used to only make the path interactive.
Icon from Font Awesome
xoxo @Martijn_Cuppens
PS. make sure to check out RFS to control your responsive font sizes.