伪类
E:link E:visited E:hover
E:active E:focus E:lang(fr)
E:not(s) E:root E:first-child
E:last-child E:only-child E:nth-child(n)
E:nth-last-child(n) E:first-of-type
E:last-of-type E:only-of-type E:nth-of-type(n)
E:nth-last-of-type(n)
E:empty E:checked E:enabled E:disabled E:target @page:first @page:left @page:right
伪对象选择器
E:first-letter/E::first-letter
E:first-line/E::first-line
E:before/E::before E:after/E::after
E::placeholder E::selection
伪类与伪元素的特性及其区别:
它们的本质区别就是是否抽象创造了新元素
- 伪类本质上是为了弥补常规CSS选择器的不足,以便获取到更多信息(可以通过添加实际的类来实现效果);
- 伪元素本质上是创建了一个有内容的虚拟容器(即添加了一个实际存在的元素来实现相应的效果);
- CSS3中伪类和伪元素的语法不同;
可以同时使用多个伪类,而只能同时使用一个伪元素;