:last-of-type

  • Revision slug: CSS/:last-of-type
  • Revision title: :last-of-type
  • Revision id: 38677
  • Created:
  • Creator: McGurk
  • Is current revision? No
  • Comment Added browser compatibility; 53 words added

Revision Content

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

Summary

The :last-of-type CSS pseudo-class represents the last sibling of the given type in the list of children of its parent element.

Syntax

element:last-of-type { style properties }

Example

To match the last data cell in a table row, you can use this:

tr > td:last-of-type

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-last-of-type") }}
  • {{ Cssxref(":first-of-type") }}
  • {{ Cssxref(":nth-of-type") }}
  • CSS3 Reference

Revision Source

<p>{{ CSSRef() }} {{ gecko_minversion_header("1.9.1") }}</p>
<h3 name="Summary">Summary</h3>
<p>The <code>:last-of-type</code> <a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">CSS pseudo-class</a> represents the last sibling of the given type in the list of children of its parent element.</p>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">element:last-of-type { <em>style properties</em> }
</pre>
<h3 name="Example">Example</h3>
<p>To match the last data cell in a table row, you can use this:</p>
<pre class="brush: css">tr &gt; td:last-of-type
</pre> <h3>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>
<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>
</div> <h3 name="See_also">See also</h3>
<ul> <li>{{ Cssxref(":nth-last-of-type") }}</li> <li>{{ Cssxref(":first-of-type") }}</li> <li>{{ Cssxref(":nth-of-type") }}</li> <li><a class="external" href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#last-of-type-pseudo">CSS3 Reference</a></li>
</ul>
Revert to this revision