Our volunteers haven't translated this article into عربي yet. Join us and help get the job done!
You can also read the article in English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The CSSKeyframesRule interface describes an object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE).

Properties

As a CSSRule, CSSKeyframesRule also implements the properties of these interfaces. It has two properties :

CSSKeyframesRule.name
Represents the name of the animation, used by the animation-name property.
CSSKeyframesRule.cssRules Read only
Returns a CSSRuleList of the CSS rules in the media rule.

Methods

As a CSSRule, CSSKeyframesRule also implements the methods of that interface. It has three specific methods:

CSSKeyframesRule.appendRule()
Inserts a new keyframe rule into the current CSSKeyframesRule. The parameter is a DOMString containing a keyframe in the same format as an entry of a @keyframes at-rule. If it contains more than one keyframe rule, a DOMException with a SYNTAX_ERR is thrown.
CSSKeyframesRule.deleteRule()
Deletes a keyframe rule from the current CSSKeyframesRule. The parameter is the index of the keyframe to be deleted, expressed as a DOMString resolving as a number between 0% and 100%.
CSSKeyframesRule.findRule()
Returns a keyframe rule corresponding to the given key. The key is a DOMString containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%. If no such keyframe exists, findRule returns null.

Specification

Specification Status Comment
CSS Animations
The definition of 'CSSKeyframesRule' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome Full support YesEdge Full support YesFirefox Full support 48
Full support 48
Full support 5
Prefixed
Prefixed Requires the vendor prefix: moz
IE Full support 10Opera Full support 12
Prefixed
Full support 12
Prefixed
Prefixed Requires the vendor prefix: -o
Safari Full support 4WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 48
Full support 48
Full support 5
Prefixed
Prefixed Requires the vendor prefix: moz
Opera Android Full support 12
Prefixed
Full support 12
Prefixed
Prefixed Requires the vendor prefix: -o
Safari iOS Full support YesSamsung Internet Android ?
appendRule
Experimental
Chrome Full support Yes
Full support Yes
No support ? — 45
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Edge ? Firefox Full support 22
Full support 22
No support 5 — 22
Alternate Name
Alternate Name Uses the non-standard name: insertRule
IE Full support 10
Alternate Name
Full support 10
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Opera Full support Yes
Alternate Name
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Safari Full support Yes
Alternate Name
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: insertRule
WebView Android Full support Yes
Full support Yes
No support ? — 45
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Chrome Android Full support Yes
Full support Yes
No support ? — 45
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Edge Mobile ? Firefox Android Full support 22
Full support 22
No support 5 — 22
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Opera Android Full support Yes
Alternate Name
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Safari iOS Full support Yes
Alternate Name
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: insertRule
Samsung Internet Android ?
cssRules
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
deleteRule
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
findRule
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
name
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Document Tags and Contributors

المساهمون في هذه الصفحة: dom96, fscholz, Sebastianz, erikadoyle, Sheppy, Mehuge, jpmedley, Tid, foolip, teoli, kohei.yoshino, gizmo_jaco@yahoo.com
آخر مَن حدّثها: dom96,