:last-of-type

  • Revision slug: CSS/:last-of-type
  • Revision title: :last-of-type
  • Revision id: 38676
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 1 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

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 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