html,css,js实现的一个钟表
效果如图: 实现代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Clock</title> <style> body { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100vw; height: 100vh; background: #2e1f27; } p{ color: #854d27; } code{ color: #f4c950; } .clock { --clock-width: 50vmin; width: var(--clock-width); height: var(--clock-width); position: relative; overflow: hidden; border: 6px solid #f4c950; border-radius: 50%; } .clock:after { content: ''; position: absolute; z-index: 10; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 6px;