Boro Omokugbo Joseph• 115
@Asylcreek
Posted
You would have to use a properties that are transitionable. Based on your markup, you could use the following:
.answer{
opacity: 0;
visibility: hidden;
position: absolute;
top: -1rem;
left: 0;
transition-property: top, opacity;
transition-duration: .2s;
}
.active{
opacity: 1;
visibility: visible;
top: 0;
position: relative;
}
The position: absolute
is to take it out of the flow of the document.
Hope it helps.
1