Want to share your CSS expertise with others? Apply to the MDN Fellowship by April 1! http://mzl.la/MDNFellowship

mozilla

Revision 57498 of :nth-last-of-type

  • Revision slug: CSS/:nth-last-of-type
  • Revision title: :nth-last-of-type
  • Revision id: 57498
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment no wording changes

Revision Content

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

Summary

The :nth-last-of-type pseudo-class matches an element that has an+b-1 siblings with the same element name after it in the document tree, for a given positive or zero value for n, and has a parent element. See {{ Cssxref(":nth-child") }} for a more thorough description of the syntax of its argument.

Syntax

element:nth-last-of-type(an + b) { style properties }

See also

Revision Source

<p>{{ CSSRef() }} {{ gecko_minversion_header("1.9.1") }}</p>
<h3 name="Summary">Summary</h3>
<p>The <code>:nth-last-of-type</code> pseudo-class matches an element that has <code><em>a</em>n+<em>b</em>-1</code> siblings with the same element name after it in the document tree, for a given positive or zero value for <code>n</code>, and has a parent element. See {{ Cssxref(":nth-child") }} for a more thorough description of the syntax of its argument.</p>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">element:nth-last-of-type(<em>a</em>n + <em>b</em>) { <em>style properties</em> }
</pre>
<h3 name="See_also">See also</h3>
<ul> <li>{{ Cssxref(":last-of-type") }}</li> <li><a class="external" href="http://www.w3.org/TR/css3-selectors/#nth-last-of-type-pseudo">CSS3 Reference</a></li>
</ul>
Revert to this revision