Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1044934 of CSSKeyframeRule

  • Revision slug: Web/API/CSSKeyframeRule
  • Revision title: CSSKeyframeRule
  • Revision id: 1044934
  • Created:
  • Creator: ttromey
  • Is current revision? No
  • Comment fixed a typo

Revision Content

{{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%'. The from keyword maps to '0%' and the to 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")}}

Revision Source

<div>{{APIRef("CSSOM")}}{{SeeCompatTable}}</div>

<p>The <strong><code>CSSKeyframeRule</code></strong> 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")}} <a href="/en-US/docs/CSS/At-rule">at-rule</a>. It implements the {{domxref("CSSRule")}} interface with a type value of <code>8</code> (<code>CSSRule.KEYFRAME_RULE</code>).</p>

<h2 id="Syntax">Syntax</h2>

<p>The syntax is described using the <a href="https://dev.w3.org/2006/webapi/WebIDL/">WebIDL</a> format.</p>

<pre class="syntaxbox">
interface CSSKeyframeRule : CSSRule {
           attribute DOMString           keyText;
  readonly attribute CSSStyleDeclaration style;
};
</pre>

<h2 id="Properties">Properties</h2>

<p>As a {{domxref("CSSRule")}}, <code>CSSKeyframeRule</code> also implements the properties of these interfaces. It has two specific properties:</p>

<dl>
 <dt>{{domxref("CSSKeyframe.keyText")}}</dt>
 <dd>Represents the key of the keyframe, like <code>'10%'</code>, <code>'75%'</code>. The <code>from</code> keyword maps to <code>'0%'</code> and the <code>to</code> keyword maps to <code>'100%'</code>.</dd>
 <dt id="cssRules">{{domxref("CSSKeyframe.style")}}&nbsp; {{readOnlyInline}}</dt>
 <dd>Returns a {{domxref("CSSStyleDeclaration")}} of the CSS style associated with the keyfrom.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p>As a {{domxref("CSSRule")}}, <code>CSSKeyframeRule</code> also implements the methods of that interface. It has no specific methods.</p>

<h2 id="Specification">Specification</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Animations', '#CSSKeyframeRule-interface', 'CSSKeyframeRule')}}</td>
   <td>{{Spec2('CSS3 Animations')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("5.0")}} {{property_prefix("-moz")}}<br />
    {{CompatGeckoDesktop(48)}}</td>
   <td>10</td>
   <td>12 {{property_prefix("-o")}}<br />
    12.50<sup>[1]</sup></td>
   <td>4.0</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("5.0")}} {{property_prefix("-moz")}}<br />
    {{CompatGeckoDesktop(48)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] See <a href="https://my.opera.com/ODIN/blog/2012/08/03/a-hot-opera-12-50-summer-time-snapshot">the blog post to Opera 12.50</a>.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{cssxref("@keyframes")}}</li>
 <li>{{domxref("CSSKeyFramesRule")}}</li>
</ul>
Revert to this revision