Let's say you have this selector:
#myElement:hover .aClassThatsUsedAcrossThePage {
outline: 1px solid red;
}
Will it select anything across the page or only descendants? I can only get it to select descendant elements.
.main {
background: lightblue;
width: 100px;
border: 1px solid gray;
}
.show {
background-color: lightgray;
}
/* select any descendant element that uses .show */
.main:hover > .show {
outline: 2px solid red;
}
/* select any element that uses .show */
.main:hover .show {
outline: 1px solid red;
}
<div class="main">
main class
<div class="show">
test
</div>
</div>
<div class="show">
Hello world
</div>