<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>animation动画效果</title>
<style type="text/css">
/* 定义动画 */
@keyframes moving { /* 定义动画及名称 */
from{
width: 10px;
}
to{
width: 1000px;
}
}
/* 风车定义 */
@keyframes rotating {
from{
transform: rotate(0deg);
}
to{
transform: rotate(360deg);
}
}
.box{
width: 100px;
height: 100px;
background-color: gold;
animation:moving 300ms ease infinite alternate;/* 该属性为综合属性后面跟着一堆值 */
}
.box:hover{
animation-play-state:paused ;
}
/* 风车旋转的样式效果设计 */
.zhuan{
display: block;
width: 500px;
height: 536px;
margin: 50px auto 0;
animation:rotating 500ms linear infinite;
}
</style>
</head>
<body>
<div class="box"></div>
<img src="风车.jpg" alt="风车图片" class="zhuan">
</body>
</html>
********
风车的图片可以自己区网上下载。