css实现闪烁效果

css yekong 191℃

wanjunshijie 2021-04-08 at 09.46.52

html

<div class="body_center_top_list_item">
<div class="xg"></div> <h3>在制项目</h3>
</div>

css

@-webkit-keyframes shine {
  0% {
    background-position-x: 400%;
  }
  50% {
    background-position-x: 0%;
  }
  100% {
    background-position-x: -400%;
  }
}

@keyframes shine {
  0% {
    background-position-x: 400%;
  }
  50% {
    background-position-x: 0%;
  }
  100% {
    background-position-x: -400%;
  }
}
.body_center_top_list_item {
    background: url("../../images/night/center_top_bg.png");
    width: 140px;
    position: relative;
}
.xg {
      background: linear-gradient(
                      -45deg, rgba(17, 95, 185, 0) 50%, rgba(20, 131, 231, 1.00) 60%, rgba(17, 95, 185, 0) 70%);
      background-size: 600% 100%;
      height: 30px;
      width: 100%;
      animation: shine 20s infinite;
      -webkit-animation-delay: 0s;
      animation-delay: 0s;
      -webkit-animation-timing-function: linear;
      animation-timing-function: linear;
      position: absolute;
      top: 7px;
      left: 0;
      z-index: 1;
    }
喜欢 (0)