You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
54 lines
1.1 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<style>
|
|
*{
|
|
margin: 0;
|
|
}
|
|
html,body{
|
|
position: relative;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
body{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
#show{
|
|
position: relative;
|
|
font-size: 5rem;
|
|
width: 500px;
|
|
height: 5rem;
|
|
}
|
|
#show>div{
|
|
text-align: center;
|
|
white-space:nowrap;
|
|
/*强制不换行*/
|
|
overflow: hidden;
|
|
|
|
background: #999;
|
|
-webkit-background-clip: text;
|
|
color: transparent;
|
|
|
|
animation: 1000ms show ease-in-out;
|
|
}
|
|
|
|
@keyframes show {
|
|
from{
|
|
width: 0;
|
|
}
|
|
to{
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="show">
|
|
<div>Hello World!</div>
|
|
</div>
|
|
</body>
|
|
</html> |