There are 5 divs on the page, all with the same class name as shown below:
Here is the CSS:
.test:hover{
color:red;
}
And here is the HTML:
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
Now, imagine these divs are in different parent divs on the page...
The goal is for all 5 divs to change to red when hovering over any of them, not just the one being hovered over...
Unfortunately, they do not share the same parents, so I can't wrap them in a parent div and use a hover effect. Is there a way to achieve this using CSS, or will I need to resort to JavaScript?