欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS實(shí)現(xiàn)字體背景跑馬燈

 更新時(shí)間:2020年01月06日 16:39:18   作者:KaiSarH  
這篇文章主要為大家詳細(xì)介紹了JS實(shí)現(xiàn)字體背景跑馬燈,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了JS實(shí)現(xiàn)字體背景跑馬燈的具體代碼,供大家參考,具體內(nèi)容如下

知識(shí)點(diǎn)

1.通過(guò) @keyframes 規(guī)則,創(chuàng)建動(dòng)畫(huà)。
2.背景作用域:

background-clip: text;
-webkit-background-clip: text;

3.background-position定位背景圖像
4.color: transparent 全透明

運(yùn)行效果

代碼

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div{
      text-align: center;
      background-color: black;
      padding: 10px 0;
    }
    .animated {
      font-family: 華文行楷, cursive;
      margin: 0;
      padding: 0;
      font-size: 100px;
      background: url('text-bg.png') no-repeat;
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      animation: moveBg 90s linear infinite;
      -webkit-animation: moveBg 90s linear infinite;
    }

    @keyframes moveBg {
      0% {
        background-position: 0 30%;
      }

      100% {
        background-position: 100% 50%;
      }
    }

  </style>
</head>
<body>
<div>
  <h1 class="animated">歡迎到來(lái)</h1>
</div>
</body>
</html>

所使用的背景圖片

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論