• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

HTML5+CSS3做有动画跳动发光的文字效果

武飞扬头像
全不栈
帮助4

纯HTML5 CSS3制作的一个超级酷的字体发光效果 ,知识点不多,只需用到 文字阴影 模糊滤镜 动画延迟。

首先给大家康康效果图:学新通

学新通

 文章的最后小编放上了效果访问的URL,感兴趣的可以看看!!

 如果有朋友们不喜欢太亮的文本阴影,那么可以在css中可以除掉文字阴影。

在关键帧最后这个位置加上

text-shadow:none。

 5%,

  95% {

    color: #111;

    filter: blur(0px);

    text-shadow: none; 

  }

HTML 代码区:

  1.  
    <!DOCTYPE html>
  2.  
    <html>
  3.  
    <head>
  4.  
    <meta charset="utf-8" />
  5.  
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  6.  
    <title>会发光的字体</title>
  7.  
    <link rel="stylesheet" href="css/style.css" />
  8.  
    </head>
  9.  
    <body>
  10.  
    <div class="container">
  11.  
    <span>s</span>
  12.  
    <span>u</span>
  13.  
    <span>p</span>
  14.  
    <span>e</span>
  15.  
    <span>r</span>
  16.  
    <span>c</span>
  17.  
    <span>o</span>
  18.  
    <span>o</span>
  19.  
    <span>l</span>
  20.  
    </div>
  21.  
    </body>
  22.  
    </html>
学新通

css 代码块:

  1.  
    * {
  2.  
    margin: 0;
  3.  
    padding: 0;
  4.  
    }
  5.  
    .container {
  6.  
    height: 100vh;
  7.  
    display: flex; /* 弹性布局,水平,垂直居中*/
  8.  
    justify-content: center;
  9.  
    align-items: center;
  10.  
    background: #333;
  11.  
    }
  12.  
    span {
  13.  
    font-size: 100px;
  14.  
    font-weight: bold;
  15.  
    text-transform: uppercase; /* 转为大写*/
  16.  
    letter-spacing: 5px; /* 字间距*/
  17.  
    color: #111;
  18.  
    filter: blur(2px); /* 模糊滤镜*/
  19.  
    animation: animate 2.5s linear infinite; /* 动画:动画名称 动画时长 线性的 无限次播放*/
  20.  
    }
  21.  
    /* 为每一个span元素设置动画延迟时间*/
  22.  
    span:nth-child(1) {
  23.  
    animation-delay: 0s;
  24.  
    }
  25.  
    span:nth-child(2) {
  26.  
    animation-delay: 0.25s;
  27.  
    }
  28.  
    span:nth-child(3) {
  29.  
    animation-delay: 0.5s;
  30.  
    }
  31.  
    span:nth-child(4) {
  32.  
    animation-delay: 0.75s;
  33.  
    }
  34.  
    span:nth-child(5) {
  35.  
    animation-delay: 1s;
  36.  
    }
  37.  
    span:nth-child(6) {
  38.  
    animation-delay: 1.25s;
  39.  
    }
  40.  
    span:nth-child(7) {
  41.  
    animation-delay: 1.5s;
  42.  
    }
  43.  
    span:nth-child(8) {
  44.  
    animation-delay: 1.75s;
  45.  
    }
  46.  
    span:nth-child(9) {
  47.  
    animation-delay: 2s;
  48.  
    }
  49.  
    @keyframes animate {
  50.  
    /* 定义动画关键帧*/
  51.  
    0%,
  52.  
    100% {
  53.  
    color: #fff;
  54.  
    filter: blur(2px); /*模糊滤镜*/
  55.  
    text-shadow: 0 0 10px #32ff7e, 0 0 20px #32ff7e, 0 0 30px #32ff7e,
  56.  
    0 0 40px #32ff7e, 0 0 100px #32ff7e, 0 0 200px #32ff7e;
  57.  
    }
  58.  
    5%,
  59.  
    95% {
  60.  
    color: #111;
  61.  
    filter: blur(0px);
  62.  
    }
  63.  
    }
学新通

接下来小编附上URL:

https://static-f758fb91-f450-4acc-879e-93a020848816.bspapp.com/

ps: 访问速度可能有点小慢,希望朋友们稍稍等待一小会儿,小编太穷了,资金不支持,只能用免费的服务器上传。

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhfiahkh
系列文章
更多 icon
同类精品
更多 icon
继续加载