.fadeout { animation: fadeOut 2.5s; animation-fill-mode: forwards; } .container { display: flex; align-items: baseline; margin-top: 10px; } .display-text { opacity: 0; margin-left: 7px; color: #23ae89; } @-webkit-keyframes fadeOut { 0% { opacity: 1; } 50% { opacity: 0.8; } 99% { opacity: 0.01; } 100% { opacity: 0; } } @keyframes fadeOut { 0% { opacity: 1; } 50% { opacity: 0.8; } 99% { opacity: 0.01; } 100% { opacity: 0; } }