I'm looking for a technical explanation, not a solution. If I have, for example, the following structure of HTML:
<div class="container">
<div class="box1">
<div class="square"></div>
</div>
<div class="box2">
<div class="circle"></div>
</div>
</div>
Why can't I create a CSS rule where if I hover over .square
, change the background color of .circle
? In other words, why can't I affect an element outside of another element's scope?
Also, will there be a time when we can do this? Are there any future plans to allow this behavior?