h1.message-wrapper { white-space: nowrap !important; } h1.message-wrapper > span { vertical-align: middle; } ul.message { position: relative; vertical-align: middle; margin: 0; padding: 0; display: inline-block; overflow: hidden; line-height: 1.25em; /* this is the line-height of the h1 */ height: 1.25em; /* with some space for the ascenders/descenders */ } ul.message li { list-style: none; text-align: left; position: relative; top: 0; /* the 3s here are the length of the ::after animation */ animation: slideit calc(4 * 3s) steps(4) infinite; } @keyframes slideit { 100% { top: calc(-4 * 1.25em); } } ul.message li span { display: inline-block; position: relative; line-height: 1.25em; } .message li span::after{ content: ""; position: absolute; left: 0; height: 100%; width: 100%; background: #fffff5; border-left: 2px solid currentColor; animation: typetytype 3s steps(10) infinite; } @keyframes typetytype { 40%, 60% { left: calc(100% + 10px); } 100% { left: 0; } }