<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
@keyframes typing {
from { width: 0; }
}
@keyframes caret {
50% { border-color: transparent; }
}
p {
width: 16em;
overflow: hidden;
white-space: nowrap;
border-right: 0.1em solid;
animation: typing 13s steps(16), caret 0.5s steps(1) infinite;
}
</style>
</head>
<body>
<p>css3动画,动态打字效果</p>
</body>
</html>
效果:
css3动画,动态|