Type
:first-of-type :last-of-type :only-of-type
li:first-of-type {background: green;}
li:last-of-type {font-size: 24px;}
li:only-of-type {font-style: italic;}
- Item 1 - green (it's the first list item in this UL)
- Item 2 - nothing cool
- Item 3 - font size 24px (it's the last item in this UL)
- Sub-item - green (it's the first item in this OL); size 24 (it's also the last item of this OL); italic (it's the only item in this OL)