transition-property

  • Revision slug: CSS/transition-property
  • Revision title: transition-property
  • Revision id: 292560
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

The transition-property CSS property is used to specify the names of CSS properties to which a transition effect should be applied.

Note: The set of properties that can be animated is subject to change; as such, you should avoid including any properties in the list that don't currently animate, because someday they might, causing unexpected results.

If you specify a shorthand property (for example, {{ cssxref("background") }}, all of its longhand sub-properties that can be animated will be.

  • {{ Xref_cssinitial() }}: all
  • Applies to: all elements, {{ cssxref("::before") }} and {{ cssxref("::after") }} pseudo elements
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified
  • {{ Xref_cssanimatable() }}: no
  • {{ Xref_csscanonicalorder() }}: the unique non-ambiguous order defined by the formal grammar

Syntax

Formal grammar: none | [ all | IDENT ] [ , [ all | IDENT ] ]*
transition-property: none
transition-property: all
transition-property: test_05
transition-property: -specific
transition-property: sliding-vertically

transition-property: test1
transition-property: test1, animation4
transition-property: all, height, all
transition-property: all, -moz-specific, sliding

Values

none
No properties will transition.
all
All properties that can have an animated transition will do so.
IDENT
A string identifying the property to which a transition effect should be applied when its value changes. This identifier is composed by case-insensitive letter a to z, numbers 0 to 9, an underscore (_) or a dash(-). The first non-dash character must be a letter (that is no number at the beginning of it, even preceded by a dash). Also two dashes are forbidden at the beginning of the identifier.

Examples

There are several examples of CSS transitions included in the main CSS transitions article.

Specifications

Specification Status Comment
{{ SpecName('CSS3 Transitions', '#transition-property', 'transition-property') }} {{ Spec2('CSS3 Transitions') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }} {{ CompatGeckoDesktop("2.0") }}{{ property_prefix("-moz") }}
{{ CompatGeckoDesktop("16.0") }}
10 {{ CompatVersionUnknown() }}{{ property_prefix("-o") }} {{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }} {{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }} {{ CompatGeckoMobile("2.0") }}{{ property_prefix("-moz") }}
{{ CompatGeckoMobile("16.0") }}
{{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>transition-property</code> CSS property is used to specify the names of CSS properties to which a <a href="/en/CSS/CSS_transitions" title="en/CSS/CSS transitions">transition effect</a> should be applied.</p>
<div class="note">
  <strong>Note:</strong> The set of properties that can be animated is subject to change; as such, you should avoid including any properties in the list that don't currently animate, because someday they might, causing unexpected results.</div>
<p>If you specify a shorthand property (for example, {{ cssxref("background") }}, all of its longhand sub-properties that can be animated will be.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}:</dfn> <code>all</code></li>
  <li><dfn>Applies to:</dfn> all elements, {{ cssxref("::before") }} and {{ cssxref("::after") }} pseudo elements</li>
  <li><dfn>{{ Xref_cssinherited() }}:</dfn> no</li>
  <li><dfn>Media:</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}:</dfn> as specified</li>
  <li><dfn>{{ Xref_cssanimatable() }}:</dfn> no</li>
  <li><dfn>{{ Xref_csscanonicalorder() }}:</dfn> the unique non-ambiguous order defined by the formal grammar</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
Formal grammar: none | [ all | IDENT ] [ , [ all | IDENT ] ]*
</pre>
<pre>
transition-property: none
transition-property: all
transition-property: test_05
transition-property: -specific
transition-property: sliding-vertically

transition-property: test1
transition-property: test1, animation4
transition-property: all, height, all
transition-property: all, -moz-specific, sliding
</pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    none</dt>
  <dd>
    No properties will transition.</dd>
  <dt>
    all</dt>
  <dd>
    All properties that can have an animated transition will do so.</dd>
  <dt>
    IDENT</dt>
  <dd>
    A string identifying the property to which a transition effect should be applied when its value changes. This identifier is composed by case-insensitive letter <code>a</code> to <code>z</code>, numbers <code>0</code> to <code>9</code>, an underscore (<code>_</code>) or a dash(<code>-</code>). The first non-dash character must be a letter (that is no number at the beginning of it, even preceded by a dash). Also two dashes are forbidden at the beginning of the identifier.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<p>There are several examples of CSS transitions included in the main <a href="/en/CSS/CSS_transitions" title="en/CSS/CSS transitions">CSS&nbsp;transitions</a> article.</p>
<h2 id="Specifications">Specifications</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 Transitions', '#transition-property', 'transition-property') }}</td>
      <td>{{ Spec2('CSS3 Transitions') }}</td>
      <td>&nbsp;</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</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}</td>
        <td>{{ CompatGeckoDesktop("2.0") }}{{ property_prefix("-moz") }}<br />
          {{ CompatGeckoDesktop("16.0") }}</td>
        <td>10</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-o") }}</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}</td>
        <td>{{ CompatGeckoMobile("2.0") }}{{ property_prefix("-moz") }}<br />
          {{ CompatGeckoMobile("16.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}{{ property_prefix("-webkit") }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/CSS/Using_CSS_transitions" title="en/CSS/CSS transitions">Using CSS transitions</a></li>
  <li>{{ domxref("TransitionEvent") }}</li>
  <li>{{ CSS_Reference:transitions() }}</li>
</ul>
Revert to this revision