Ich füge eine Animation hinzu, wenn sie "display: block;" :Wie kann ich nur CSS verwenden, um eine Animation hinzuzufügen, um zwischen "display: none;" und "display: block;"
.button:hover > .list {
display: block;
}
.list {
display: none;
animation: listshow 0.8s ease normal;
}
@keyframes listshow {
\t 0% {
\t \t opacity: 0;
\t }
\t 100% {
\t \t opacity: 1;
\t }
}
<div class="button">
<div>Show</div>
<ul class="list">
<li>1</li>
<li>2</li>
</ul>
</div>
Aber wie ich eine Animation hinzufügen kann, wenn sie sich "display: none;" ?
Danke für Ihre Zeit.
Mögliche Duplikat [Reverse-CSS-Animation auf: Hover] (http://stackoverflow.com/questions/41225205/reverse-css-animation-on-hover) –