css3动画纪录

学习了css3动画

<!DOCTYPE html>
<html>
<head>
<style> 
#test
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove infinite;
animation-duration:2s;

/* Safari and Chrome */
-webkit-animation:mymove infinite;
-webkit-animation-duration:2s;
}

@keyframes mymove
{
from {top:0px;}
to {top:200px;}
}

@-webkit-keyframes mymove /* Safari and Chrome */
{
from {top:0px;}
to {top:200px;}
}
</style>
</head>
<body>

<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-name 属性。</p>

<div id="test"></div>

<p><b>注释:</b>始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。</p>

</body>
</html>

效果:

注释:Internet Explorer 9 以及更早的版本不支持 animation-name 属性。

 

注释:始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。

具体应用:

https://github.com/fengnovo/diary/blob/master/others/css3/a.html
演示:http://htmlpreview.github.io/?https://github.com/fengnovo/diary/blob/master/others/css3/a.html

原文地址:https://www.cnblogs.com/fengnovo/p/5978770.html