Child
:first-child :only-child :last-child
li:first-child {background: green;}
li:last-child {font-size: 24px;}
li:only-child {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)