css fade in fade out code example
Example 1: css fade out
.fade-out {
animation: fadeOut 2s;
opacity: 0;
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
Example 2: css fade in and stay
.fadePopInAndStay {
display: block;
opacity: 0;
visibility: visible;
animation-name: doAnimStay;
animation-duration: 2s;
animation-fill-mode: forwards;
}
@-webkit-keyframes doAnimStay{
0% {opacity:0;}
100% {opacity:1;}
}
Example 3: css fade out
.successfully-saved {
color: #FFFFFF;
text-align: center;
-webkit-transition: opacity 3s ease-in-out;
-moz-transition: opacity 3s ease-in-out;
-ms-transition: opacity 3s ease-in-out;
-o-transition: opacity 3s ease-in-out;
opacity: 1;
}
.successfully-saved.hide-opacity {
opacity: 0;
}