HTML:
<div class="container">
<div class="parent">one
<div class="child">two</div>
</div>
</div>
CSS:
.parent {
background: red;
height: 200px;
width: 200px;
}
.child {
background: green;
height: 100px;
width: 100px;
margin-top: 50px;
margin-left: 50px;
}
/* insted of apply individual */
/* .parent:hover {
background: blue;
}
.child:hover {
background: black;
}
*/
I want to change both parent and child background colours. when hover on parent(parent bg:blue, child bg:black). Here the problem is parent & child have the same property(background) but both have different background colours. how can I apply them simultaneously?