initial

  • Revision slug: CSS/initial
  • Revision title: initial
  • Revision id: 292749
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The initial CSS keyword is applies the initial value of a property to an element. It is allowed on every CSS property and causes the element for which it is specified to use the initial value of the property.

Examples

 /* give headers a green border */
 h2 { border: medium solid green }

 /* but make those in the sidebar use the value of the "color" property */
 #sidebar h2 { border-color: -moz-initial; border-color: initial; }
 <p style="color:red"> 
    this text is red 
       <em style="color:-moz-initial; color:initial"> 
          this text is in the initial color (e.g. black)
       </em>
    this is red again
 </p> 

Specifications

Specification Status Comment
CSS Values and Units Level 3 {{ Spec2('CSS3 Values') }} Defines the keyword
CSS Cascade And Inheritance Level 3 {{ Spec2('CSS3 Cascade') }} Defines what an initial value is

 

Browser compatibility

Browser Lowest version Support of
Internet Explorer --- ---
Firefox (Gecko) 1.0-3.0 (1.0-1.9) [*] -moz-initial
Opera --- ---
Safari (WebKit) 1.2 (125) initial

[*] Increasing support in each version, almost complete in Firefox 3.0

  • Support for {{ cssxref("quotes") }} since Firefox 3.5 (Gecko 1.9.1)
  • Support for {{ cssxref("-moz-border-top-colors","-moz-border-*-colors") }} since Firefox 3.6 (Gecko 1.9.2)

See also

Initial value, {{ cssxref("inherit") }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>initial</code> CSS keyword is applies the initial value of a property to an element. It is allowed on every CSS property and causes the element for which it is specified to use the <a href="/en/CSS/initial_value" title="en/CSS/initial_value">initial value</a> of the property.</p>
<h2 id="Examples">Examples</h2>
<pre class="brush: css">
 /* give headers a green border */
 h2 { border: medium solid green }

 /* but make those in the sidebar use the value of the "color" property */
 #sidebar h2 { border-color: -moz-initial; border-color: initial; }
</pre>
<pre class="brush: css">
 &lt;p style="color:red"&gt; 
    this text is red 
       &lt;em style="color:-moz-initial; color:initial"&gt; 
          this text is in the initial color (e.g. black)
       &lt;/em&gt;
    this is red again
 &lt;/p&gt;&nbsp;</pre>
<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><a class="external" href="http://www.w3.org/TR/css3-values/#keywords" title="http://www.w3.org/TR/css3-values/#keywords">CSS Values and Units Level 3</a></td>
      <td>{{ Spec2('CSS3 Values') }}</td>
      <td>Defines the keyword</td>
    </tr>
    <tr>
      <td><a class="external" href="http://www.w3.org/TR/css3-cascade/#initial0" title="http://www.w3.org/TR/css3-cascade/#initial0">CSS Cascade And Inheritance Level 3</a></td>
      <td>{{ Spec2('CSS3 Cascade') }}</td>
      <td>Defines what an initial value is</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th>Browser</th>
      <th>Lowest version</th>
      <th>Support of</th>
    </tr>
    <tr>
      <td>Internet Explorer</td>
      <td>---</td>
      <td>---</td>
    </tr>
    <tr>
      <td>Firefox (Gecko)</td>
      <td>1.0-<strong>3.0</strong> (1.0-1.9) [*]</td>
      <td><code>-moz-initial</code></td>
    </tr>
    <tr>
      <td>Opera</td>
      <td>---</td>
      <td>---</td>
    </tr>
    <tr>
      <td>Safari (WebKit)</td>
      <td><strong>1.2</strong> (125)</td>
      <td><code>initial</code></td>
    </tr>
  </tbody>
</table>
<p>[*] Increasing support in each version, almost complete in Firefox 3.0</p>
<ul>
  <li>Support for {{ cssxref("quotes") }} since Firefox 3.5 (Gecko 1.9.1)</li>
  <li>Support for {{ cssxref("-moz-border-top-colors","-moz-border-*-colors") }} since Firefox 3.6 (Gecko 1.9.2)</li>
</ul>
<h2 id="Specifications" name="Specifications">See also</h2>
<p><a class="internal" href="/en/CSS/initial_value" title="en/CSS/initial value">Initial value</a>, {{ cssxref("inherit") }}</p>
Revert to this revision