I have a below div and css,
.parent:hover{
background-color:violet;
}
.child:hover{
background-color:grey;
}
<div style='border:2px solid red;width:200px;height:100px' class='parent'>
</div>
<div style='margin-top:25px;margin-left:50px;border:2px solid gray;width:100px;height:50px' class='child'>
</div>
here i have achieved when i hover the parent the background color violet has been applied as well as child. But i need to achieve when i hover the parent the child class also need to apply to the corresponding div.. as well as when i hover child the parent class also need to apply on that corresponded div how to achieve?