Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2016.
* Some parts of this feature may have varying levels of support.
The CSSKeyframesRule interface describes an object representing a complete set of keyframes for a CSS animation. It corresponds to the contents of a whole @keyframes at-rule.
CSSRule CSSKeyframesRuleInherits properties from its ancestor CSSRule.
CSSKeyframesRule.nameRepresents the name of the keyframes, used by the animation-name property.
CSSKeyframesRule.cssRules Read onlyReturns a CSSRuleList of the keyframes in the list.
CSSKeyframesRule.length Read onlyReturns the number of keyframes in the list.
Inherits methods from its ancestor CSSRule.
CSSKeyframesRule.appendRule()Inserts a new keyframe rule into the current CSSKeyframesRule. The parameter is a string 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 string resolving as a number between 0% and 100%.
CSSKeyframesRule.findRule()Returns a keyframe rule corresponding to the given key. The key is a string 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.
The CSS includes a keyframes at-rule. This will be the first CSSRule returned by document.styleSheets[0].cssRules. myRules[0] returns a CSSKeyframesRule object.
CSSKeyframesRule can be indexed like an array, and functions similar to its cssRules property.
| CSS Animations Level 1 # interface-csskeyframesrule |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Nov 7, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.