css3中的animation-name属性的用法:【animation-name: keyframename|none】。该属性用来给@keyframes动画规定名称。
css3 animation-name属性
作用:animation-name 属性为 @keyframes 动画规定名称。
语法:
animation-name: keyframename|none;
keyframename:规定需要绑定到选择器的 keyframe 的名称。
none:规定无动画效果(可用于覆盖来自级联的动画)。
注:需始终设置 animation-duration 属性,否则当时长为 0时,就不会播放动画了。
css3 animation-name属性的使用示例
<!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>
效果图:
以上就是本篇文章的全部内容,希望能对大家的学习有所帮助。更多精彩内容大家可以关注相关教程栏目!!!
以上就是css3中的animation-name属性怎么用的详细内容。