MDN’s new design is in Beta! A sneak peek:


This translation is incomplete. Please help translate this article from English.


La pseudo-classe CSS :last-child representa qualsevol element sent l'últim element fill del seu pare.


:last-child { style properties }


Contingut HTML

  <li>This item is not limed.</li>
  <li>Also not this one.</li>
  <li>This item is! :)</li>

Contingut CSS

li:last-child {
  background-color: lime;


Especificació Estat Comentari
Selectors Level 4
The definition of ':last-child' in that specification.
Working Draft Sense canvis
Selectors Level 3
The definition of ':last-child' in that specification.
Recommendation Definició inicial

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 1.0 1.0 (1.7 or earlier) 9.0 9.5 3.2
Característica Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic 2.1 1.0 (1) 9.0 10.0 3.2


Document Tags and Contributors

 Contributors to this page: Legioinvicta
 Last updated by: Legioinvicta,