页面模拟霓虹灯效果
html+css实现页面模拟霓虹灯效果 <!doctype html><html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>霓虹灯</title>
<style type="text/css">
body{background-color: #00688B;}
.text{
font-size: 64px;
font-weight: normal;
text-transform: uppercase;/*大写 lowercase小写;capitalize单词首字母大写*/
fill:none;
stroke: #B0E0E6;
stroke-width: 2px;
stroke-dasharray: 90 310;
animation: stroke 6s infinite linear;
}
.text-1{
stroke: #FFEC8B;
animation-delay:-1.5s;
text-shadow:5px 5px 5px #FFEC8B;
}
.text-2{
stroke:#AEEEEE;
animation-delay:-3s;
text-shadow:5px 5px 5px #7FFFD4;
}
.text-3{
stroke:#EEE0E5;
animation-delay:-4.5s;
text-shadow:5px 5px 5px #7FFFD4;
}
.text-4{
stroke:#FFC1C1;
animation-delay:-6s;
text-shadow:5px 5px 5px #7FFFD4;
}
@keyframes stroke {
to {
stroke-dashoffset: -400;
}
}
</style>
</head>
<body>
<svg width="100%" height="100" style="margin:100px auto">
<text text-anchor="middle" x="50%" y="50%" class="text text-1" >
Happy birthday to you❤
</text>
<text text-anchor="middle" x="50%" y="50%" class="text text-2" >
Happy birthday to you❤
</text>
<text text-anchor="middle" x="50%" y="50%" class="text text-3" >
Happy birthday to you❤
</text>
<text text-anchor="middle" x="50%" y="50%" class="text text-4" >
Happy birthday to you❤
</text>
</svg>
</body>
</html> 落红护花 发表于 2022-4-12 13:57
问一下为什么要写4个text
@rundreamer
霓虹灯,利用时间差,营造动态效果 怎么改字号大小? 楼主辛苦了 这个真的是厉害,羡慕羡慕 感谢感谢,好东西 semiuel 发表于 2022-4-12 12:38
怎么改字号大小?
font-size 问一下为什么要写4个text
@rundreamer 又学一招,感谢分享~ 学会了感谢