I know that there does not exist a CSS parent selector, but is it possible to style a parenting element when hovering a child element without such a selector?
To giv
A simple jquery solution for those who don't need a pure css solution:
$(".letter").hover(function() { $(this).closest("#word").toggleClass("hovered") });
.hovered { background-color: lightblue; } .letter { margin: 20px; background: lightgray; } .letter:hover { background: grey; }
T E S T