I'm trying to figure out how to affect surrounding elements which have the same class name. My elements with the same class are stacked side by side within a parent div and then they continue within another child div. Is it possible to affect all of the same class divs on hover so that the hovered element has a opacity: 1 and others 0.5?
My selector looks like that below, but it only affects div
s within same level and only the ones after the hovered element (I would like affect all of them):
icon:hover ~ .icon {
opacity: 0.3;
}
For easier demo: Fiddle
Any suggestions appreciated, :)