I have a span
element that's classed. When I hover over a child element, I want the siblings to all fade in. How can I achieve this?
SCSS code
.move-tools {
> a {
opacity: 0.0;
a ~ a:hover {
opacity: 1.0;
transition: opacity 0.5s ease-in-out;
}
&:hover {
opacity: 1.0;
transition: opacity 0.5s ease-in-out;
}
}
}
HTML code
<div>
<span class="move-tools">
<a href title="Move to bottom">Move to bottom</a>
<a href title="Move down one place">Move down</a>
<a href title="Move up one place">Move up</a>
<a href title="Move to top">Move to top</a>
</span>
</div>
Here's a link to the JSFiddle.
I tried to use the a ~ a
selector to bring the opacity of the sibling elements through, but I think I'm misunderstanding the documentation.