In my script there are three divs. I want to display div with class="ab"
when I hover on first line and display div with class="abc"
, when hover on second line. Otherwise I want to display div with class="a"
by default.
But it never displays the div with class="a"
.
.abc,.ab {
display: none;
}
#f:hover ~ .ab {
display: block;
}
#f:hover ~ .abc,.a {
display: none;
}
#s:hover ~ .abc {
display: block;
}
#s:hover ~ .ab,.a {
display: none;
}
<a id="f">Show First content!</a>
<br/>
<a id="s">Show Second content!!</a>
<div class="a">Default Content</div>
<div class="ab">First content</div>
<div class="abc">Second content</div>
Here is my JSFiddle of my problem: JSFiddle Link
.a
when one of the others is hovered over". – Shriner