I have two different boxes when want to be able to change the properties of one box as I hover somewhere else.
I figured that if I have both boxes in the same container it works as you can see on my snippet here. Here my html and css:
.first {
color: blue;
background: black;
width: 299px;
}
.first:hover + .second {
background: red;
color: white;
}
.second {
color: red;
background: black;
width: 300px;
margin-left: 10px;
}
.container {
display: flex;
}
<div class="container">
<div class="first">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam delectus quo corporis, n
</div>
<div class="second">
Lorem ipsum dolor sit amet, consectetur adipisicing e et magnam rem, doloribus libero quas numquam esse in culpa!
</div>
</div>
But how can I do the same thing if the boxes are not in the same container?
Thanks in advance.