css3之旋转太极图

c535a37cc131b9cf7d8af4cd3b5e6cd1443.jpg旋转太极图

太极图可由6个部分组成:

c6361c6bf4e7c15461e1d25c01f06fb9c4e.jpg

将图片的位置放在合适的位置就能组成一张太极图。

首先在div容器内画上以上的6图案:

		<div id="box">
			<ul id="vessel">
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
			</ul>
		</div>
            #box{
				width: 300px;
				height: 300px;
				border: 10px red hidden;
				margin-left: 100px;
				margin-top: 50px;
				position: relative;
			}
			#box #vessel{
				width: 300px;
				height: 300px;
				list-style: none;
				margin-left: 50px;
				margin-top: 50px;
				position: relative;
			}
			#box #vessel li:nth-of-type(1){
				width: 200px;
				height: 200px;
				background-color: black;
				border-radius: 50%;
				position: absolute;
			}
			#box #vessel li:nth-of-type(2){
				width: 100px;
				height: 200px;
				background-color: white;
				border-radius: 0 100px 100px 0;
				position: absolute;
				right: 100px;
			}
			#box #vessel li:nth-of-type(3){
				width: 100px;
				height: 100px;
				background-color: black;
				border-radius: 50%;
				position: absolute;
				left: 50px;
			}
			#box #vessel li:nth-of-type(4){
				width: 100px;
				height: 100px;
				background-color: white;
				border-radius: 50%;
				position: absolute;
				left: 50px;
				top: 100px;
			}
			#box #vessel li:nth-of-type(5){
				width: 50px;
				height: 50px;
				background-color: white;
				border-radius: 50%;
				position: absolute;
				left: 75px;
				top: 25px;
			}
			#box #vessel li:nth-of-type(6){
				width: 50px;
				height: 50px;
				background-color: black;
				border-radius: 50%;
				position: absolute;
				left: 75px;
				top: 125px;
			}

完成后就能组成58e379ad874c8db904b1bf9f90c9eea42eb.jpg

接下来让图片旋转就行了

创建动画

@keyframes Rotate{
                from{transform: rotate(0deg);}
                to{transform: rotate(360deg);}
}

让整个DIV饶中心旋转就OK啦 在#box样式内加

animation: Rotate 2s infinite linear;
 transform-origin: 150px 100px;

搞定.

e82bfe40a5e133c41849ff68cbd19850477.jpg

b700a3c8be765f97ef7e94498aff63f428c.jpg

ca47814f7a09732d886d868e132b44ea9b3.jpg

转载于:https://my.oschina.net/u/4069817/blog/3040160

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值