Skip to main content
正在加载
正在点亮星图
Weaving the Star Map
教程

WordPress网站添加新春倒计时代码

Contents
    WordPress网站添加新春倒计时代码

    <div class="card" style="background: url(https://pic.liesys.com/i/2022/12/21/63a2d91b57c8f.png) no-repeat; background-size: cover;"><br>
    <center>
    <b><h4><p><span style="color: #ffffff;">2023年新春倒计时</span></p></h4></b>
    <b><h5><p><span style="color: #ffffff;">谎伴导航</span></p></h5></b>
    </center>
    <div class="gn_box">
    <center>
    <div id="CountMsg" class="HotDate text-light">
    <span style="color: #ffffff;"><span id="t_d">10天</span>
    <span id="t_h">10时</span>
    <span id="t_m">10分</span>
    <span id="t_s">10秒</span></span>
    </div><br>
    </center><br>
    <script type="text/javascript"> function getRTime() {
    var EndTime = new Date('2023/01/21 00:00:00');     //可以修改时间
    var NowTime = new Date();
    var t = EndTime.getTime() - NowTime.getTime();
    var d = Math.floor(t / 1000 / 60 / 60 / 24);
    var h = Math.floor(t / 1000 / 60 / 60 % 24);
    var m = Math.floor(t / 1000 / 60 % 60);
    var s = Math.floor(t / 1000 % 60);
    document.getElementById("t_d").innerHTML = d + " 天";
    document.getElementById("t_h").innerHTML = h + " 时";
    document.getElementById("t_m").innerHTML = m + " 分";
    document.getElementById("t_s").innerHTML = s + " 秒";
    }
    setInterval(getRTime, 1000);
    </script>
    </div>
    </div><style>
    .copyright {
    margin-top: 10px;
    padding: 10px;
    background: #5f9ea0;
    border-radius: 5px;
    color : #f0ffff;
    }
    .copyright .copyright-title {
    padding: 5px;
    text-align: center;
    }
    .copyright .copyright-title h3 {
    font-size: 18px;
    }
    .copyright .copyright-text {
    font-size: 15px;
    line-height: 25px;
    }
    .copyright .copyright-url {
    margin: 5px 0;
    }
    </style>

     

    Copyright
    The copyright of the article belongs to the author, please do not reprint without permission.

    Related posts

    Comments No comments yet

    Write a comment Sign in to join the discussion

    No comments yet

    Add some experience, ask a question, or point out what's wrong — it all helps whoever reads this later. Not sure where to start? Pick one:

    Was this useful to you? Have you been through something similar? Anything you'd like to follow up on?

    Write a comment

    Visitor Just a nickname to comment
    0 / 800

    Not shown publicly.