dawnnnnnn 发表于 2022-4-12 15:20

html+css实现页面模拟霓虹灯效果

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>

KSwei718 发表于 2022-4-12 15:42

6666

834710740 发表于 2022-4-12 15:43

谢谢分享

2188492106 发表于 2022-4-12 15:56

多谢楼主分享

二货日常 发表于 2022-4-12 15:57

谢谢大牛

yhy836 发表于 2022-4-12 16:17


支持楼主,谢谢分享。

mlj2003318 发表于 2022-4-13 07:10

支持楼主,谢谢分享。
页: [1]
查看完整版本: html+css实现页面模拟霓虹灯效果