效果如下
思路写在注释里面啦

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>时钟</title>
<style>
.box {
margin: 100px auto;
width: 300px;
height: 300px;
border: 10px solid #cccccc;
position: relative;
}
.box .cir {
width: 15px;
height: 15px;
background-color: #ccc;
}
.box>.line {
height: 300px;
width: 10px;
position: absolute;
background-color: #cccccc;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
/* 指定刻度线的位置 */
.box>.line2 {
width: 7px;
transform: translate(-50%, -50%) rotateZ

本文通过HTML和CSS3实现了一个动态时钟效果,特别是秒针具有逼真的抖动动画,详细思路在代码注释中进行了解析。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



