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 469409 of CSSKeyframeRule

  • Revision slug: Web/API/CSSKeyframeRule
  • Revision title: CSSKeyframeRule
  • Revision id: 469409
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment Updated tags

Revision Content

{{ CSSOMRef() }}

{{ 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 sepcific properties:

keyText
Represents the key of the keyframe, like '10%', '75%'. The from keyword maps to '0%' and the to keyword maps to '100%'.
style Read only
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") }} 10 12 {{ property_prefix("-o") }}
12.10 #
4.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown() }} {{ CompatGeckoMobile("5.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

  • {{CSSOM}}
  • {{ cssxref("@keyframes") }}

Revision Source

<p>{{ CSSOMRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<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" title="/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="Properties" name="Properties">Syntax</h2>
<p>The syntax is described using the <a href="https://dev.w3.org/2006/webapi/WebIDL/" title="https://dev.w3.org/2006/webapi/WebIDL/">WebIDL</a> format.</p>
<pre>
interface CSSKeyframeRule : CSSRule {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attribute DOMString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; keyText;
&nbsp; readonly attribute CSSStyleDeclaration style;
};
</pre>
<h2 id="Properties" name="Properties">Properties</h2>
<p>As a {{ domxref("CSSRule") }}, <code>CSSKeyframeRule</code> also implements the properties of these interfaces. It has two sepcific properties:</p>
<dl>
  <dt>
    <code>keyText</code></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">
    <code>style</code> <span class="inlineIndicator readOnly readOnlyInline" title="This">Read only </span></dt>
  <dd>
    Returns a {{domxref("CSSStyleDeclaration")}} of the CSS style associated with the keyfrom.</dd>
</dl>
<h2 id="Methods" name="Methods">Methods</h2>
<p>As a {{ domxref("CSSRule") }}, <code>CSSKeyframeRule</code> also implements the methods of that interface. It has no specific methods.</p>
<dl>
</dl>
<h2 id="Specification" name="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") }}</td>
        <td>10</td>
        <td>12 {{ property_prefix("-o") }}<br />
          12.10 <a href="https://my.opera.com/ODIN/blog/2012/08/03/a-hot-opera-12-50-summer-time-snapshot" title="https://my.opera.com/ODIN/blog/2012/08/03/a-hot-opera-12-50-summer-time-snapshot">#</a></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&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatGeckoMobile("5.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{CSSOM}}</li>
  <li>{{ cssxref("@keyframes") }}</li>
</ul>
Revert to this revision