This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
The CSSKeyframeRule interface describes an object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE).
Syntax
The syntax is described using the WebIDL format.
interface CSSKeyframeRule : CSSRule {
attribute DOMString keyText;
readonly attribute CSSStyleDeclaration style;
};
Properties
As a CSSRule, CSSKeyframeRule also implements the properties of these interfaces. It has two sepcific properties:
CSSKeyframe.keyText- Represents the key of the keyframe, like
'10%','75%'. Thefromkeyword maps to'0%'and thetokeyword maps to'100%'. CSSKeyframe.styleRead only- Returns a
CSSStyleDeclarationof the CSS style associated with the keyfrom.
Methods
As a CSSRule, CSSKeyframeRule also implements the methods of that interface. It has no specific methods.
Specification
| Specification | Status | Comment |
|---|---|---|
| CSS Animations The definition of 'CSSKeyframeRule' in that specification. |
Working Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | (Yes) | 5.0 (5.0) | 10 | 12 -o 12.50[1] |
4.0 |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | 5.0 (5.0) | ? | ? | ? |
[1] See the blog post to Opera 12.50.
See also
- CSS Object Model:
CSSRule,CSSStyleRule,CSSMediaRule,CSSPageRule,CSSKeyframesRule,CSSKeyframeRule,CSSNamespaceRule,CSSSupportsRule,CSSGroupingRule,CSSConditionRule @keyframes