.line { width: 24em; top: 50%; margin: auto; border-right: 2px solid rgba(255, 255, 255, 0.75); text-align: center; white-space: nowrap; overflow: hidden; transform: translateY(-50%); } .anim-typewriter { animation: typewriter 4s steps(46) 1s 1 normal both, blinkTextCursor 500ms steps(46) infinite normal; } @keyframes typewriter { from { width: 0; } to { width: 11.5em; /* 11.5em */ } } @media(max-width: 768px) { @keyframes typewriter { from { width: 0; } to { width: 10.5em; /* 10.5em */ } } } @keyframes blinkTextCursor { from { border-right-color: rgba(255, 255, 255, 0.75); } to { border-right-color: transparent; } }