How to display hidden css classes on hover
<a class="a1">Show the first</a>
<a class="a2">Show the second</a>
<div class="div1">The first</div>
<div class="div2">The second</div>
I think it's clear
thanks!
How to display hidden css classes on hover
<a class="a1">Show the first</a>
<a class="a2">Show the second</a>
<div class="div1">The first</div>
<div class="div2">The second</div>
I think it's clear
thanks!
A CSS only option would be to have 2 classes and with one you hide the div
element as with the others you display it using the pseudo selector :hover
div {
display: none;
}
a:hover + div {
display: block;
}
You can use the general sibling selector:
div { display: none; }
.a1:hover ~ .div1 { display: block; }
.a2:hover ~ .div2 { display: block; }