Issue description:
I want to make the class .first
and class .third
visible after :hover
over class .second
by using the display: unset
css command. Actuall issue is, that I can change the display of the element implemented after (.third
) the class .second
and not the element implemented before (.first
). I tried every me known selector for the classes that should affect onto the hover
(+
and ~
and space
);
Code
.container {
display: flex;
flex-direction: column;
justify-content: center;
}
.first {
background: red;
display: none;
}
.second {
background: blue;
}
.third {
background: red;
display: none;
}
.second:hover + .first {
display: flex;
}
.second:hover + .third{
display: flex;
}
<div class="container">
<div class="first">First</div>
<div class="second">Second</div>
<div class="third">Third</div>
</div>
Further information: I know it's possible to solve this by getting the value class via JavaScript and edit the style properties. This is not what i want. I want a pure CSS solution.
Thank's for your help