:root

  • Revision slug: CSS/:root
  • Revision title: :root
  • Revision id: 71148
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

{{ CSSRef() }}

Summary

The :root pseudo-class represents 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>
<h3 name="Summary">Summary</h3>
<p>The<code> :root </code><a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-class</a> represents 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><h3 class="editable"><span>Specifications</span></h3>
<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>
<h3 name="Browser_compatibility">Browser compatibility</h3>
<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>
Revert to this revision