风车案例案例:
关键代码:
transform: rotate(120deg); 旋转120度。
transition:2s; 旋转120度花2秒完成。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
html,body{
height: 100%;
overflow: hidden;
}
#wrap{
width: 300px;
height: 300px;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
transition:2s;
border: 1px solid;
}
#wrap > div{
margin: 10px;
width: 130px;
height: 130px;
border: 1px solid;
background: deeppink;
float: left;
box-sizing: border-box;
}
#wrap > div:nth-child(1),#wrap > div:nth-child(4){
border-radius:0 60%;
}
#wrap > div:nth-child(2),#wrap > div:nth-child(3){
border-radius:60% 0;
}
#wrap:hover{
transform: rotate(120deg);
}
</style>
</head>
<body>
<div id="wrap">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>