#学习笔记#(35)CSS3模拟时钟

代码如下

<!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>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值