怎么用Css的animation创建动画

这篇“怎么用Css的animation创建动画”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“怎么用Css的animation创建动画”文章吧。

网站建设哪家好,找创新互联!专注于网页设计、网站建设、微信开发、微信小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了郊区免费建站欢迎大家使用!

通过 css3,我们能够创建动画,这可以在许多网页中取代动画图片、Flash动画以及 JavaScript。

CSS3 @keyframes规则

如需在 CSS3中创建动画,您需要学习 @keyframes规则。

@keyframes规则用于创建动画。在 @keyframes中规定某项 CSS样式,就能创建由当前样式逐渐改为新样式的动画效果。

那么如何使用Css的animation动画改版背景和位置,代码如下:

@keyframes myfirst

{

0%   {background: red; left:0px; top:0px;}

25%  {background: yellow; left:200px; top:0px;}

50%  {background: blue; left:200px; top:200px;}

75%  {background: green; left:0px; top:200px;}

100% {background: red; left:0px; top:0px;}

}

 

@-moz-keyframes myfirst /* Firefox */

{

0%   {background: red; left:0px; top:0px;}

25%  {background: yellow; left:200px; top:0px;}

50%  {background: blue; left:200px; top:200px;}

75%  {background: green; left:0px; top:200px;}

100% {background: red; left:0px; top:0px;}

}

 

@-webkit-keyframes myfirst /* Safari和 Chrome */

{

0%   {background: red; left:0px; top:0px;}

25%  {background: yellow; left:200px; top:0px;}

50%  {background: blue; left:200px; top:200px;}

75%  {background: green; left:0px; top:200px;}

100% {background: red; left:0px; top:0px;}

}

 

@-o-keyframes myfirst /* Opera */

{

0%   {background: red; left:0px; top:0px;}

25%  {background: yellow; left:200px; top:0px;}

50%  {background: blue; left:200px; top:200px;}

75%  {background: green; left:0px; top:200px;}

100% {background: red; left:0px; top:0px;}

}

以上就是关于“怎么用Css的animation创建动画”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注创新互联行业资讯频道。


网页题目:怎么用Css的animation创建动画
分享路径:http://bzwzjz.com/article/gpipoo.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站建设 成都网站建设 成都营销网站建设 成都网站建设 成都网站制作 营销型网站建设 高端网站建设 成都网站建设流程 温江网站设计 成都网站制作 成都网站设计公司 营销网站建设 成都网站制作 重庆企业网站建设 成都网站制作 成都网站建设公司 四川成都网站制作 成都网站建设 成都网站制作 重庆网站制作 重庆网站建设 成都网站制作