alioth/before/cha/06===BPEMR/xi-note-computer/Xi-A-Program/Xi-A2-前端知识/CSS/test2.html
2025-05-30 09:18:01 +08:00

54 lines
1.1 KiB
HTML

<!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>