I am looking to create a custom hover effect for highlighting elements in a Chrome extension I'm developing. The goal is to achieve a similar behavior to using the magnifying glass tool in Chrome Dev Tools, where only the hovered element is highlighted.
After exploring CSS pseudo :hover and trying various jQuery solutions, I have found that these methods also apply the hover effect to container elements due to event bubbling. Preventing this behavior with CSS alone seems impossible.
One attempted solution involved using JavaScript to remove and add a specific class on mouseover, but it still selected parent elements along with the target element.
.hova {
background-color: pink;
}
Another approach was using CSS opacity to highlight the element, but ultimately had the same issue with selecting parent elements instead of just the targeted one.
It seems like there should be a straightforward solution out there, potentially being over complicated by the fact that it's part of a Chrome extension development. I'm open to any suggestions or advice on achieving the desired hover effect.