position 属性把元素放置到一个静态的、相对的、绝对的、或固定的位置中。
<!DOCTYPEHTML>
<html>
<head>
<meta charset="utf-8">
<title>永不停止的风车</title>
<style type="text/css">
.pinwheel {
width:140px;
height:140px;
-webkit-transform-origin:69px 73px;
-webkit-animation-name:keyname;
-webkit-animation-duration:2s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-timing-function:linear;
}
.pinwheel span{
width:100px;
height:50px;
display:block;
opacity:0.6;
position:relative;
border-radius:25px;
}
.pinwheel .one{
background-color:#f00;
-webkit-transform:skew(30deg);
top:48px;
left:38px;
}
.pinwheel .tow{
background-color:#00f;
-webkit-transform: rotate(120deg) skew(30deg);
top:18px;
left:5px;
}
.pinwheel .three{
background-color:#060;
-webkit-transform: rotate(240deg) skew(30deg);
top:-72px;
left:5px;
}
.pinwheel .point{
position:relative;
top:-90px;
left:45px;
}
.tree{
position:relative;
top:-78px;
left:65px;
border-radius:10px 10px 0 0;
height:200px;
width:10px;
background-color:#999;
background:-webkit-gradient(linear, left top, right top, from(#ffcc00), to(#cc0033));
z-index:-1;
}
.tree img{
width:10px;
}
@-webkit-keyframes keyname {
from {
-webkit-transform:rotate(0);
}
to {
-webkit-transform:rotate(360deg);
}
}
</style>
</head>
<body>
<!--风车扇叶-->
<div class="pinwheel"> <span class="one"></span><span class="tow"></span><span class="three"></span></div>
<!--风车杆-->
<div class="tree"><img src="images/point.png" /></div>
</body>
</html>
转载请注明原文地址:https://ipadbbs.8miu.com/read-46180.html