CSS做个五颜六色的风车

  • 做个简单的风车
    身为一个Java小白会用css做点风车不过分吧
     Pay attention to:this is living 风车,不是 lifeless 的风车*
    
  • 代码:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/new_file.css" />
	</head>
	<body>
		<div class="container">
			<div class="box">
				<div class="box1 box2"></div>
				<div class="box1 box3"></div>
				<div class="box1 box4"></div>
				<div class="box1 box5"></div>/*四片叶子做完了*/
			</div>
			<div class="gan"></div>/*这是杆子*/
		</div>
	</body>
</html>

  • 这是名为 new_file.css的css文件
.container {
	border: 0px solid red;
	width: 700px;
	height: 600px;
	margin: 30px auto;
}

.box {
	border: 0px solid red;
	width: 200px;
	height: 200px;
	margin: 20px auto;

	animation: animation1 2s linear infinite;
	/* 名称/一周期时间/线性变化/无线 */
}

.box1 {
	width: 100px;
	height: 50px;
	border-radius: 50px 50px 0 0;
	position: relative;
}

@keyframes animation1 {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

.box2 {
	border: 0px solid greenyellow;
	background-color: blue;
	transform: rotate(90deg);
	position: relative;
	top: 25px;
	left: 75px;

}

.box3 {
	border: 0px solid blue;
	background-color: red;
	transform: rotate(180deg);
	position: relative;
	left: 100px;
	top: 50px;

}

.box4 {
	border: 0px solid red;
	background-color: orangered;
	transform: rotate(270deg);
	position: relative;
	left: 25px;
	top: 25px;
}

.box5 {
	border: 0px solid orangered;
	background-color: greenyellow;
	transform: rotate(0deg);
	position: relative;
	/* 相对位置 */
	bottom: 100px;
}

.gan {
	border: 2px solid saddlebrown;
	width: 10px;
	height: 400px;
	background-color: #008000;
	position: relative;
	left: 345px;
	bottom: 121px;
	z-index: -1;
}

这是个会动的风车,自行脑补吧,哈哈(其实是因为我不会放动图)

  • 注:这个风车会 rotating,自行脑补吧,哈哈(其实是因为我不会放动图)
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值