Browser support for CSS :first-child and :last-child
Solution 1:
:first-child
and :last-child
, along with complimentary compatibility chart.
:first-child
is supported IE9 properly, and IE7 and IE8 sort of (see chart).
:last-child
is supported by IE9+ only.
Both of them are supported well by the good browsers.
Solution 2:
"Can I use..." should be your go to resource for these types of questions. Here's are the compatibility tables:
first-child
- http://caniuse.com/#feat=css-sel2
last-child
- http://caniuse.com/#feat=css-sel3
Solution 3:
Here's a nice table illustrating different browser support.