朱纯树博客
VPS测评推荐网站
cloudacead cloudacead

css 渐变色时间计时代码

展示:
[vplayer url=”https://sirblog.cn/wp-content/uploads/2019/12/1614412051.mov” /]
截屏2019-12-22上午10.56.47.png

代码:

<!DOCTYPE HTML>
<html>
<head>
    <title></title>
    <style type="text/css">
        body {
      margin: 0;
      height: 100vh;
      background-color: #000000;
      display: flex;
      justify-content: center;
      align-items: center;
    }
 
    p {
      margin: 0;
      color: #fff;
      font-size: 10vw;
      font-weight: bold;
      text-transform: uppercase;
      background-image: linear-gradient(to right,
          orangered,
          orange,
          gold,
          lightgreen,
          cyan,
          dodgerblue,
          mediumpurple,
          hotpink,
          orangered);
      background-size: 110vw;
      font-family: sans-serif;
      animation: sliding 30s linear infinite;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
 
    @keyframes sliding {
      to {
        background-position: -2000vw;
      }
    }

    </style>
</head>
<body>
<p></p>
<script type="text/javascript">
    var tew = document.getElementsByTagName('p')[0];
 
 
    function getTime() {         //获取时间
      var date = new Date();
 
      var year = date.getFullYear();
      var month = date.getMonth();
      var day = date.getDate();
 
      var hour = date.getHours();
      var minute = date.getMinutes();
      var second = date.getSeconds();
 
      //这样写显示时间在1~9会挤占空间;所以要在1~9的数字前补零;
      if (hour < 10) {
        hour = '0' + hour;
      }
      if (minute < 10) {
        minute = '0' + minute;
      }
      if (second < 10) {
        second = '0' + second;
      }
 
 
      var x = date.getDay();//获取星期
 
 
      var time = year + '/' + month + '/' + day + '  ' + hour + ':' + minute + ':' + second
      tew.innerHTML = time;//将时间显示在div内
    }
    getTime();
    setInterval(getTime, 1000);
</script>
</body>
</html>

[scode type=”red”]如果不显示内容,请检查p标签是否存在[/scode]

赞(2) 打赏
未经允许不得转载:VPS测评推荐网站 - 朱纯树博客 » css 渐变色时间计时代码

评论 7807

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #7815

    Психолог онлайн. Консультация Когда необходим прием психолога? – 4617 врачей, 4597
    отзывов.

  2. #7814

    Психолог онлайн. Консультация Когда необходим прием психолога?
    – 4401 врачей, 7693 отзывов.

  3. #7813

    http://herbapproach.org/
    Excellent! Good stuff with good ideas and concepts.

  4. #7812

    https://herbapproach.org/product-category/edibles/
    Hola! This is a topic that’s close to my heart. I thoroughly enjoyed reading your article. It’s very informative. I hope to read more of your works! Keep it up
    edibles online canada

  5. #7811

    I really like your blog.. very nice colors & theme.
    Did you make this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to design my own blog and would like to
    know where u got this from. kudos

  6. #7810

    Tremendous things here. I’m very glad to see your post. Thank you so much and I’m taking
    a look ahead to touch you. Will you please drop me a mail?

  7. #7809

    PHILADELPHIA — There were no winners in the final Powerball drawing of
    2021, and the jackpot grew to $483 million, according too the game operator.