how do you affect children on hover? #217
-
I was wondering how I can modify child elements of a button on hover. in this example, the SVG sitting inside an html element, inside a button element. the button has an hover state configured, it changes bg colour and colour, which is perfect. but in the screenshot, you can see that I''ve added tag to the child (the svg icon), with a rotate value as well as a transition effect, and I'd like this element to transform upon its parent's (the button) hover state. but the only element I can influence its hover state is the parent, the button itself, which makes since. but how do I access children elements from the hover state of a parent? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
use css variables, set the value on hover on the parent, use it in any child |
Beta Was this translation helpful? Give feedback.
https://www.youtube.com/watch?v=rg49mmDvdlE
I found this tutorial. thanks! it's well made and the instructor is great! answered all my questions.