Revision 289361 of :root

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

Revision Content

{{ CSSRef() }}

Summary

The :root pseudo-class matches the root element of a tree representing the document. In HTML, :root represents the {{ HTMLElement("html") }} element and is identical to the selector html, except that its specifity is higher.

Specifications

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1 {{ CompatGeckoDesktop("1.7") }} 9 9.5 1.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

 

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The<code> :root </code><a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-class</a> matches the root element of a tree representing the document. In HTML,<code> :root </code>represents the {{ HTMLElement("html") }} element and is identical to the selector<code> html</code>, except that its <a href="/en/CSS/Specificity" title="Specificity">specifity</a> is higher.</p>
<h2 class="editable" id="Specifications"><span>Specifications</span></h2>
<ul>
  <li><a class="external" href="http://www.w3.org/TR/css3-selectors/#root-pseudo" rel="external nofollow" target="_blank" title="http://www.w3.org/TR/css3-selectors/#root-pseudo">CSS 3 Selectors #root-pseudo</a></li>
</ul>
<h2 id="Browser_compatibility" name="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>1</td>
        <td>{{ CompatGeckoDesktop("1.7") }}</td>
        <td>9</td>
        <td>9.5</td>
        <td>1.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 Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<p> </p>
Revert to this revision