@byronbyron
Posted
Hi Michal
Not sure if you've come across transitioning the max-height
instead. Works best when you know the height will never go above a certain value, in this case 100px
.
.answer__body {
padding: 0;
line-height: 1.8rem;
width: 90%;
max-height: 0;
overflow: hidden;
transition: max-height 1s;
}
.answer-visible {
max-height: 100px;
}
.answer-visible p {
margin-bottom: 1.5rem;
}
<div class="answer__body answer-visible" data-selected="1">
<p>You can invite up...</p>
</div>
Everything else looks good! 👍
Marked as helpful