代码如下
<!DOCTYPE html>
<html>
<head>
<title>模拟时钟</title>
<meta charset="UTF-8"/>
<style>
*{
margin:0px;
padding:0px;
}
.bg{
background-color:black;
width:100%;
height:600px;
position:absolute;
}
.box{
width:200px;
height:200px;
margin:100px auto;
border-radius:50%;
position:relative;
}
.border-line{
border:1px solid #fff;
}
.box2{
width:150px;
height:150px;
margin:25px auto;
border-radius:50%;
position:relative;
}
.line-s{
position:absolute;
width:1px;
height:100px;
top:75px;
left:50%;
background-color:white;
animation:round 60s infinite;
animation-timing-function:linear;
}
.line-h{
position:absolute;
width:1px;
height:50px;
top:75px;
left:50%;
background-color:white;
animation:round 3600s infinite;
animation-timing-function:linear;
}
@keyframes round{
0%{
transform-origin:0 0;
transform:rotate(0deg);
}
100%{
transform-origin:0 0;
transform:rotate(360deg);
}
}
.position-absolute{
position:absolute;
color:white;
}
.top{
top:0px;
left:48%;
}
.left{
top:49%;
left:2%;
}
.bottom{
bottom:1%;
left:48%;
}
.right{
top:49%;
right:2%;
}
.dot{
width:10px;
height:10px;
border-radius:50%;
background-color:white;
position:absolute;
top:48%;
left:47%;
}
.return{
bottom:50px;
right:50px;
position:fixed;
width:60px;
height:60px;
background-color:#ccc;
opacity:0.8;
color:green;
font-size:12px;
font-family:微软雅黑;
text-align:center;
line-height:60px;
border-radius:50%;
}
.return:hover{
opacity:1;
}
a{
color:green;
text-decoration:none;
}
</style>
</head>
<body>
<div class="bg">
<div class="box border-line">
<div class="position-absolute top">12</div>
<div class="position-absolute right">3</div>
<div class="position-absolute bottom">6</div>
<div class="position-absolute left">9</div>
<div class="box2 border-line">
<div class="line-s"></div>
<div class="line-h"></div>
<div class="dot"></div>
</div>
</div>
</div>
<div class="return"><a href="../../coding.html">点我返回</a></div>
</body>
</html>