English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The animation-The nameCSS property specifies the name@keyframes that should be applied to the selected element to define the animation.
The table below summarizes the usage context and version history of this property.
Default Value: | none |
---|---|
Applicable To: | All elements::before and::after Pseudo-element |
Inheritance: | No |
Animatable: | No.See Also Animation Attribute. |
Version: | CSS3new feature |
JavaScript Syntax: | object object.style.animationName="mymove" |
The syntax of this attribute is as follows:
animation-name: keyframe-name | none | initial | inherit
The following example demonstrates how to use animation-name Attribute.
.box { width: 50px; height: 50px; background: red; position: relative; /* Chrome, Safari, Opera */ -webkit-animation-name: moveit; -webkit-animation-duration: 2s; animation-name: moveit; animation-duration: 2s; } /* Chrome, Safari, Opera */ @-webkit-keyframes moveit { from {left: 0;} to {left: 50%;} } @keyframes moveit { from {left: 0;} to {left: 50%;} }Test See‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
keyframe-name | Specify the name of the keyframes to be bound to the selector. |
none | Specify no animation. This can be used to override or disable any animation from the cascade. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element uses its parent element's animation-Calculated Value of name Attribute. |
animation-Browser Compatibility of name Attribute, all mainstream browsers support this attribute.
|
Please refer to the following tutorial:CSS3Animation.
Related Attributes and Rules:animation,animation-duration,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,animation-fill-mode,animation-play-state,@keyframes.