欢迎光临散文网 会员登陆 & 注册

HTML+CSS:文字波浪效果

2022-08-20 10:45 作者:huawei13Pro  | 我要投稿

来源:我的学习笔记

动态效果图静态展示:

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>the-waves-words</title>

<style type="text/css">

*{

margin: 0;

padding: 0;

font-family: "lucida console"o;

}

body{

display: flex;

justify-content: center;

align-items: center;

min-height: 100vh;

background: #000;

}

.wavy{

position: relative;

-webkit-box-reflect: below -12px linear-gradient(transparent,rgba(0,0,0,0.2));

}

.wavy span{

position: relative;

display: inline-block;

color: #fff;

font-size: 2em;

text-transform: uppercase;

animation: animate 1s ease-in-out infinite;

animation-delay: calc(0.1s * var(--i));

}

@keyframes animate{

0%{

transform: translateY(0px);

}

20%{

transform: translateY(-20px);

}

40%,100%{

transform: translateY(0px);

}

}

</style>

</head>

<body>

<div class="wavy">

<span style="--i:1;">L</span>

<span style="--i:2;">o</span>

<span style="--i:3;">a</span>

<span style="--i:4;">d</span>

<span style="--i:5;">i</span>

<span style="--i:6;">n</span>

<span style="--i:7;">g</span>

<span style="--i:8;">.</span>

<span style="--i:9;">.</span>

<span style="--i:10;">.</span>

</div>

</body>

</html>


HTML+CSS:文字波浪效果的评论 (共 条)

分享到微博请遵守国家法律