css的动画效果在style标签中用@keyframes name{。。。}的形式定义,使用animation:name time 。。。的形式进行调用。
示例:
<style>
@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;} }
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:myfirst 5s;
}
</style>
欢迎评论
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
您可能感兴趣的文章:
css3 flex布局 justify-content:space-between 最后一行左对齐
网友评论