<div class="box">Hello World</div>
@keyframes fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.box {
animation: fade-out 1000ms;
animation-fill-mode: forwards;
}
.box {
width: 100px;
height: 100px;
background: slateblue;
padding: 8px;
display: grid;
place-content: center;
color: white;
text-align: center;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.