When I animate some properties like height below, once the animation is finished it snaps back to either a different height or no height. I have tried setting height: auto
so that I can stay at 100% but that didn't seem to do anything. Not sure what I am missing so that the attribute's value is retained at the end of the animation.
.parent {
animation: expand 3s 1;
}
@keyframes expand {
from {
width: 0%;
height: 0%;
}
to {
width: 50%;
height: 100%;
}
}
<div class="parent" style="background-color: red;">
</div>