更多的选择器
更多的伪类选择器 :
- first-child,选中a元素,a元素必须是第一个子元素
a:first-child{
}
选中第一个子元素
如果a元素不是第一个子元素,则无法被选中
first-of-type,选中子元素中第一个指定类型的元素
-
last-child
last-of-type
与1.同理
-
nth-chile
选中指定的第几个元素
- nth-of-type
选中某指定类型的第几个元素
更多的伪元素选择器 ::
- first-letter
选中元素中第一个字母
- first-line
选中元素中第一行
- selection
选中被用户框选的文字