HTML and CSS Reference
In-Depth Information
<div id="anim1"> Watch me move and change size! </div>
CSS3 Proposed
Chrome 3+, Safari 3.1+
• WebKit supports this property as -webkit-animation-direction .
• If the animation-direction is alternate , the timing function will also alternate
if appropriate.
• Firefox 3.7 pre-releases show support for CSS transitions which are very related to
CSS animation. It is quite likely that a form of this property using the -moz prefix
may be supported in a Firefox browser by the time you read this.
This property is used to define the time it takes one iteration of an animation to play.
animation-duration: time [, time ]*
where time is a valid time value like 5s or 3500ms. The initial value of time is 0, meaning no
animation plays.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> CSS Animations - animation-duration </title>
<style type="text/css">
@-webkit-keyframes move {
from {left: 0;top: 0;}
50% {left: 300px;top: 0;}
to {left: 300px;top: 300px;}
@-webkit-keyframes resize {
from {width: 100px;height: 300px;}
50% {width: 100px;height: 100px;}
to {width: 300px;height: 100px;}
#anim1 {-webkit-animation-name:move, resize;
-webkit-animation-duration: 4s, 10s;
background-color: purple;}
Search WWH ::

Custom Search