I have a dropdown menu structured like the code below, whose HTML code I can modify (also no adding of javascript unless can sneak it into a style tag). All buttons status-button except the "on" button should be invisible, until the "on"-button is being hovered over. Also, the search-box should always stay visible and not trigger the hover event, because that would move it down as soon as someone hovers over it -> bad UX
I successfully implemented that in CSS, but, as you can see, when you try to hover over the dropdown content they start to disappear one after another. How can I solve that?
.status-menu .status-button.on {
display: block;
clear: both;
}
.status-menu .status-button.on:hover ~ .status-button {
display: block;
}
.status-menu .status-button {
display: none;
clear: both;
}
.status-menu .status-button:hover ~ .status-button {
display: block;
}
<div class="status-menu">
<a class="status-button on">...</a>
<a class="status-button">...</a>
<a class="status-button">...</a>
<div class="search-container">
<div id="search-box"><input type="text" value=""></div>
<a id="search-button">
<i class="fa fa-search"></i>
</a>
</div>