I have a container, and two texts inside where one is hidden, that is display:none. I want that when I hover the container, the hidden text appears. Everything is working well, except that I want a slide down effect the hidden text appears. Here what I did:
<div id="maincontainer">
<p>Hover on the container</p>
<p id="hiddentext">Hey, I'm visible!</p>
</div>
<style>
#hiddentext {
text-align:center;
display:none;
transform: translateY(0);
transition: all .3s ease-out;
color:#fff;
font-family:'lato',sans-serif;
}
#maincontainer:hover>#hiddentext {
display:block;
transform: translateY(10%);
}
</style>
The hidden text is appearing, but not with a slide down effect. I have seen other tutorials where they do this with opacity and visibility, however, it leaves the extra space which I do not want. So, I am using the "display" property here. Can someone help?