首页 > 其他 > 详细

线条围绕 div 中心转圈 效果

时间:2016-09-26 18:06:11      阅读:141      评论:0      收藏:0      [点我收藏+]

1. 用到知识:

CSS:animate  ,clipe

2.原理: 用clip 属性 将div  切边 ,会出现 切边的动态效果,然后内部的div 遮住外部的div  ,流出一部分 作为边;

就是旋转的效果;

 

代码如下:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>边缘线条转圈效果</title>
 </head>
 <style>
	#f1{width:500px;height:500px;position:absolute;background:red;}
	@keyframes clips{
		0%{
			clip:rect(0px 220px 2px 10px)
		}
		25%{
			clip:rect(0px 2px 220px 10px)
		}
		50%{
			clip:rect(218px 220px 210px 10px)
		}
		70%{
			clip:rect(0px 220px 220px 210px)
		}
		100%{
			clip:rect(0px 220px 2px 10px)
		}
	}
	#f1{animation:clips  8s linear infinite
}
 </style>
 <body>
  <div id="f1">


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

  

 

线条围绕 div 中心转圈 效果

原文:http://www.cnblogs.com/vali/p/5909950.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!