首页 > 开发 > CSS > 正文

利用纯css3实现的文字亮光特效的代码演示

2024-07-11 08:30:20
字体:
来源:转载
供稿:网友

  今天给大家分享一款纯css3实现的文字亮光特效。这款特效文字上一道亮光逐渐扫过文字。效果非常漂亮。一起看下效果:

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1. <span class="shiny"><span class="inner-shiny">Shiny</span> </span>  

  css3代码:

CSS Code复制内容到剪贴板
  1. body    {   
  2.   background: #111;    }   
  3.    .shiny   
  4. {      color: #F5C21B;   
  5.   background: -webkit-gradient(linear, left top, left bottombottom, from(#F5C21B), to(#D17000));      -webkit-background-clip: text;   
  6.   -webkit-text-fill-color: transparent;      display:block;   
  7.   width:610px;      margin:auto;   
  8.   font-family: "Source Sans Pro", sans-serif;      font-size: 13em;   
  9.   font-weight: 900;      position: relative;   
  10.   text-transform: uppercase;    }   
  11.    .shiny::before   
  12. {        background-position: -180px;   
  13.     -webkit-animation: flare 5s infinite;      -webkit-animation-timing-function: linear;   
  14.   background-image: linear-gradient(65deg, transparent 20%, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.3) 27%, transparent 27%, transparent 100%);      -webkit-background-clip: text;   
  15.   -webkit-text-fill-color: transparent;      content: "Shiny";   
  16.   color: #FFF;      display: block;   
  17.   padding-right: 140px;      position: absolute;   
  18. }      
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表