{{APIRef("CSSOM")}}{{SeeCompatTable}}
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 {{cssxref("@keyframes")}} at-rule. It implements the {{domxref("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 {{domxref("CSSRule")}}, CSSKeyframeRule
also implements the properties of these interfaces. It has two specific properties:
- {{domxref("CSSKeyframe.keyText")}}
- Represents the key of the keyframe, like
'10%'
,'75%'
. Thefrom
keyword maps to'0%'
and theto
keyword maps to'100%'
. - {{domxref("CSSKeyframe.style")}} {{readOnlyInline}}
- Returns a {{domxref("CSSStyleDeclaration")}} of the CSS style associated with the keyfrom.
Methods
As a {{domxref("CSSRule")}}, CSSKeyframeRule
also implements the methods of that interface. It has no specific methods.
Specification
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Animations', '#CSSKeyframeRule-interface', 'CSSKeyframeRule')}} | {{Spec2('CSS3 Animations')}} | Initial definition |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("5.0")}} {{property_prefix("-moz")}} {{CompatGeckoDesktop(48)}} |
10 | 12 {{property_prefix("-o")}} 12.50[1] |
4.0 |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("5.0")}} {{property_prefix("-moz")}} {{CompatGeckoDesktop(48)}} |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] See the blog post to Opera 12.50.
See also
- {{cssxref("@keyframes")}}
- {{domxref("CSSKeyFramesRule")}}