I'm stuck with a very, very basic problem. Searched a bit, but couldn't find any answer. These are my nested classes. in .css file. Here's the code:
.x{
color: blue;
}
.y{
color: red;
}
.x:hover{
opacity: 0.1;
}
.y:hover{
opacity: 1;
}
<div class= "x">
<div class = "y">
<p>ABC</p>
</div>
</div>
At color property color of ABC is red so child overrides parent. But when it comes to hovering, opacity is 0.1 as parent overrides child. What's going under this behavior? I know it's basic, so any help would be appreciated.
stackblitz: https://stackblitz.com/edit/angular-ivy-srdbcw?file=src/app/app.module.ts