今天看代码的时候发现了两个没有使用过的伪类

  1. :fisrt-of-type
  2. :last-of-type

fisrt-of-type 表示一组兄弟元素中其类型的第一个元素

Vegetables:
1. Tomatoes
2. Cucumbers
3. Mushrooms
Fruits:
4. Apples
5. Mangos
6. Pears
7. Oranges
1
2
3
4
5
6
7
8
9
10
11
dt {
font-weight: bold;
}

dd {
margin: 3px;
}

dd:first-of-type {
border: 2px solid orange;
}

last-of-type 表示了在(它父元素的)子元素列表中,最后一个给定类型的元素

多了一种用来处理一系列同标签元素首位样式的问题。