原文来自掘金:[令人惊叹的文字交融效果,只需几行 CSS 代码就能实现!](https://juejin.cn/post/7245316146336563261#comment)
完整代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body {
padding: 0;
margin: 0;
}
.container {
height: 100vh;
background: #000;
display: flex;
align-items: center;
justify-content: center;
filter: contrast(10);
}
.text {
font-size: 30px;
color: #fff;
animation: extend 3s forwards;
}
@keyframes extend {
0% {
letter-spacing: -13px;
filter: blur(5px);
}
100% {
letter-spacing: 0;
filter: blur(0);
}
}
</style>
<body>
<div class="container">
<div class="text">Life is a fxxking movie</div>
</div>
</body>
</html>