css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

Trying to solve a problem proposed by @uniphil in /pen/oLIGv and /pen/Bkpjq...

If you want to add a buffer to your hover regions, you might increase padding to make your element take up more space. If you've got overlapping hover regions, however, only one will be triggered on hover.

Here are two hacks (pointer-events: none and z-index: -1) that address this issue and let multiple hover states trigger (almost) simultaneously.


  1. Nice stuff. Z-index is a good solution. I would probably avoid using pointer-events for this as it won't work in older browsers sadly.

  2. Very true. Z-index can also be animated, so there are some cool possibilities there that I played around with for a while.

    For anyone who is interested, here is the compatibility table for pointer-events. Looks pretty good, and then you notice the IE column... :(

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.