1. 程式人生 > >css 打字效果 ,純css

css 打字效果 ,純css

1.非原創

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style>
		html{font-size: 10px;}
h1 { width: 23rem; overflow: hidden; white-space: nowrap; animation: typing 13s steps(23);
animation: typing 13s;}
@keyframes typing { from { width: 0; } } 
@keyframes caret { 50% {border-color: transparent;} } 
h1 { width: 23rem; overflow: hidden; white-space: nowrap; border-right: 0.2em solid; animation: typing 13s steps(23), caret 0.5s steps(1) infinite;
	</style>
	<body>
		<from><h1>123456789123456789123</h1></from>
	</body>
</html>