Usage of animation-name attribute in CSS3: [animation-name: keyframename|none]. This attribute is used to specify a name for the @keyframes animation.
##css3 animation-name attribute
Function: animation The -name attribute specifies the name for the @keyframes animation.
Syntax:
animation-name: keyframename|none;
Note: The animation-duration attribute must always be set, otherwise when the duration is 0, the animation will not be played.
css3 animation-name attribute usage example
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; position:relative; animation-name:mymove; animation-duration:5s; /* Safari and Chrome */ -webkit-animation-name:mymove; -webkit-animation-duration:5s; } @keyframes mymove { from {left:0px;} to {left:200px;} } @-webkit-keyframes mymove /* Safari and Chrome */ { from {left:0px;} to {left:200px;} } </style> </head> <body> <p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-name 属性。</p> <div></div> <p><b>注释:</b>始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。</p> </body> </html>
The above is the detailed content of How to use the animation-name attribute in CSS3. For more information, please follow other related articles on the PHP Chinese website!