Revision 47168 of :only-of-type

  • Revision slug: CSS/:only-of-type
  • Revision title: :only-of-type
  • Revision id: 47168
  • Created:
  • Creator: enderandpeter
  • Is current revision? No
  • Comment Changed "element...have" to "element...has"; 1 words added, 1 words removed

Revision Content

{{ CSSRef() }} {{ gecko_minversion_header("1.9.1") }}


The :only-of-type pseudo-class represents any element that has no siblings of the given type.


element:only-of-type { style properties }

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{ CompatGeckoDesktop("1.9.1") }} 9.0 9.5 3.2
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 2.1 {{ CompatGeckoMobile("1.9.1") }} 9.0 10.0 3.2

See also

  • {{ Cssxref(":nth-of-type") }}
  • {{ Cssxref(":first-of-type") }}
  • {{ Cssxref(":last-of-type") }}
  • CSS3 Reference

Revision Source

<p>{{ CSSRef() }} {{ gecko_minversion_header("1.9.1") }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>The <code>:only-of-type</code> <a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-class</a> represents any element that has no siblings of the given type.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval">element:only-of-type { <em>style properties</em> }
<h3 id="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.0</td> <td>{{ CompatGeckoDesktop("1.9.1") }}</td> <td>9.0</td> <td>9.5</td> <td>3.2</td> </tr> </tbody> </table>
<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>2.1</td> <td>{{ CompatGeckoMobile("1.9.1") }}</td> <td>9.0</td> <td>10.0</td> <td>3.2</td> </tr> </tbody> </table>
<h3 id="See_also" name="See_also">See also</h3>
<ul> <li>{{ Cssxref(":nth-of-type") }}</li> <li>{{ Cssxref(":first-of-type") }}</li> <li>{{ Cssxref(":last-of-type") }}</li> <li><a class="external" href="" title="">CSS3 Reference</a></li>
Revert to this revision