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.