I need to style an element when I hover with the mouse above it. But, I don't want to style its parent DOM elements. However, when I use :hover the element in question is styled just as I want, but unfortunately, all of its parents are styled too
*:hover {
border-color: red;
}
main,
article,
div {
border: 1px solid lightgrey;
padding: 30px;
}
*:hover {
border-color: red;
}
<main>
<article>
<div>
</div>
</article>
</main>
The outer border shall be red only if the cursor is between the outer border and the middle border. The middle order shall be red only if the cursor is between the middle border and the inner border. The inner border shall be red only if the cursor is inside the inner border.
Is there a way to only style the DOM element being hovered (which can be any element)? or can I only achieve this goal with javascript?

