I'm trying to make a hidden div appear and disappear smoothly using CSS, but it's not working. Can anyone help me understand what the issue might be?
Here's the HTML code:
<div class="a">
<p>Hover Me</p>
<div class="box">
Some Text Some Text Some Text Some Text Some Text Some Text
</div>
</div>
And here's the CSS code:
.box {
width: 500px;
border: 1px solid #ccc;
visibility: hidden;
height: 0;
overflow: hidden;
}
.a:hover .box {
visibility: visible;
transition: height 0.1s ease;
height: auto;
}
If you want to check out the code in action, you can visit this Fiddle Work link.