码迷,mamicode.com
首页 > 移动开发 > 详细

八卦图绕矩形旋转移动

时间:2016-08-07 23:20:35      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
@keyframes bagua{

25%{transform:translate(500px) rotate(360deg);}
50%{transform:translate(500px,500px) rotate(720deg);}
75%{transform:translate(0,500px) rotate(1080deg);}
100%{transform:translate(0,0) rotate(1440deg);}
}
@-webkit-keyframes bagua{

25%{transform:translate(500px) rotate(360deg);}
50%{transform:translate(500px,500px) rotate(720deg);}
75%{transform:translate(0,500px) rotate(1080deg);}
100%{transform:translate(0,0) rotate(1440deg);}
}
#div {
width: 96px;
height: 48px;
background: white;
border-color: #000000;
border-style: solid;
border-width: 2px 2px 50px 2px;
border-radius: 100%;
position: relative;
animation:bagua 8s;
-webkit-animation:bagua 8s ease 1s infinite normal ;
}
#div:before {
content: "";
position: absolute;
top: 50%;
left: 0;
background: white;
border: 18px solid black;
border-radius: 100%;
width: 12px;
height: 12px;
}

#div:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
background: #000000;
border: 18px solid white;
border-radius:100%;
width: 12px;
height: 12px;

}
#mydiv{
width:600px;
height: 600px;
border:1px solid gray;

}
</style>
</head>
<body>
<div id="mydiv">
<div id="div">

</div>
</div>
</body>
</html>

八卦图绕矩形旋转移动

标签:

原文地址:http://www.cnblogs.com/223y/p/5747449.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!