How to change the style of child element when there is hover on parent element. I would prefer a CSS solution for this if possible. Is there any solution possible through :hover CSS selectors. Actually I need to change color of options bar inside a panel when there is an hover on the panel.
Looking to support all major browsers.
Yes, you can definitely do this:
This uses the
:hoverpseudoclass to restrict to elements matching.parentwhich are also hovered, and the descendant combinator (space) to select any descendant that matches.child.Here’s a live example: