Skip to content
Advertisement

Selecting second child div while hovering on first child div in makeStyles Material UI

I have a parent div and two child divs, I want to apply CSS to the second child div when I hover on the first child div. This is the structure of the render method.

JavaScript

What is the material UI’s makeStyles syntax for selecting child classes on hover?

Advertisement

Answer

You can use element+element selector to select the element after the current element:

JavaScript

Live Demo

Edit 67190862/selecting-second-child-div-while-hovering-on-first-child-div-in-makestyles-mater

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement