<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- css样式 -->
<style>
/* 设置钟表大小 */
.clock {
width: 520px;
height: 520px;
margin: 20px auto;
position: relative;
}
/* 设置表盘 */
#dial {
width: 500px;
height: 500px;
background-color: pink;
border-radius: 50%;
border: 10px solid palevioletred;
position: relative;
}
/* 设置刻度 */
#dial span {
width: 4px;
height: 12px;
background-color: white;
position: absolute;
top: 0;
left: 248px;
transform-origin: 0 250px;
}
/* 表针 */
#hand {
width: 20px;
height: 20px;
position: absolute;
top: 245px;
left: 245px;
}
/* 时针 */
#hour {
width: 8px;
height: 88px;
background: #000;
position: absolute;
left
利用js写动态旋转钟表
最新推荐文章于 2023-12-08 18:53:08 发布
本文介绍如何利用JavaScript和CSS3技术实现一个动态旋转的钟表效果,详细探讨了时间更新机制和CSS3动画在钟表指针转动中的应用。
摘要由CSDN通过智能技术生成