HTML CSS examples for CSS Animation:Text
Create animated typing
<html> <head> <title>multiline typing animation</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> @keyframes typing {<!-- w ww. j a v a 2 s . c om--> from { width: 100% } to { width: 0 } } .container { position: relative; font-family: Consolas, monospace; } .typing { position: absolute; top: 0; margin: 0; z-index: -1; } .hiders { margin: 0; position: absolute; top: 0; width: 100%; } .hiders p { position: relative; clear: both; margin: 0; float: right; width:0; background: white; animation: typing 2s steps(30, end); animation-fill-mode: both; } .hiders p:nth-child(2) { animation-delay: 2s; } .hiders p:nth-child(3) { animation-delay: 4s; } .hiders p:nth-child(4) { animation-delay: 6s; } .hiders p:nth-child(5) { animation-delay: 8s; } </style> </head> <body> <div class="container"> <p class="typing"> this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test </p> <div class="hiders"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> </body> </html>