<!DOCTYPE html>
<html>
<head>
<style>
    body {
        background-color: black;
    }
<pre><code>#clock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 200px;
    font-family: &quot;Arial&quot;, sans-serif;
    text-shadow: 0px 0px 10px #fff;
}
</code></pre>
</style>
</head>
<body>
    <div id="clock"></div>
<pre><code>&lt;script&gt;
    function updateClock() {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var time = hours + &quot;:&quot; + minutes + &quot;:&quot; + seconds;
        document.getElementById('clock').innerHTML = time;
    }

    setInterval(updateClock, 1000);
&lt;/script&gt;
</code></pre>
</body>
</html>

原文地址: https://www.cveoy.top/t/topic/pRd6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录