Let's say I have to divs named "A" and "B", respectively.
<div id="A">
<div id="B">
</div>
</div>
div A has a z-index of 1 and has a width and height of 100%. div B has a z-index of 2 and has a width and height of 50% and a top and left of 25%;
#A{
position:absolute;
width:100%
height:100%;
top:0%;
left:0%;
z-index:1;
background-color:black;
}
#B{
position:absolute;
width:50%;
height:50%;
left:25%;
top:25%;
z-index:2;
background-color:gray
}
If you were to hover over Div A and Div B at the same time, Div A will still register as being hovered over. In this hypothetical scenario, whenever I hover over Div A, I want Div A to turn Red and Div B to turn Gray, and whenever I hover over Div B, I want Div B to be Blue and Div A to be Black. How can I do this? I would prefer a CSS answer if there is one available.
I would think using #A:not(hover){}
would work, but when I tried it, it failed.