HTML写出永不停止的风车
1.使用HBuilder前端开发工具写代码,运行后如图:
2.具体代码如下:
直接粘贴复制
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>永不停止的风车</title>
<style type="text/css">
.box{
width:160px;
height:160px;
animation:move 2s infinite linear;
}
span{
display:block;
width:100px;
height:50px;
border-radius:25px;
opacity:0.6;
}
.one{
background-color:red;
transform:skew(30deg);
position:relative;
left:55px;
top:60px;
}
.two{
background-color:blue;
transform:rotate(120deg) skew(30deg) ;
position:relative;
left:5px;
top:30px;
}
.three{
background-color:#0F9;
transform: rotate(240deg) skew(30deg) ;
position:relative;
left:15px;
top:-70px;
}
.wheel{
width:11px;
height:220px;
background:url(images/tree.PNG);
position:relative;
left:70px;
top:-80px;
z-index:-1;
border-radius:10px 10px 0 0;
}
.wheel img{
width:10px;
height:10px;
display:block;
}
@keyframes move{
0%{
transform:rotate(0deg);
}
100%{
transform:rotate(360deg);
}
}
</style>
</head>
<body>
<div class="box">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
<div class="wheel">
<img src="file:///C|/Users/万卫/Desktop/images/point.png"/>
</div>
</body>
</html>
总结
本次的知识分享就到这了,谢谢你这么好看还关注我,下期再见!