CSS选择器4
接上篇CSS选择器3
#####2.CSS3伪类选择器
| 选择器 | 含义 |
|---|---|
| E:ennabled | 匹配表单中激活的元素 |
| E:disabled | 匹配表单中禁用的元素 |
| E:checked | 匹配表单中被选中的radio(单选框)或checkbox(复选框)元素 |
| E::selection | 匹配用户当前选中的元素 |
| E:not(s) | 反选伪类。匹配不符合当前选择器的任何元素 |
| E:target | 匹配文档中特定"id"点击后的效果 |
| E:root | 匹配文档的根元素,对于HTML文档,就是HTML元素 |
| E:nth-child(n) | 匹配父元素的第n个子元素,第一个编号为1。 |
| E:nth-last-child(n) | 匹配其父元素的倒数第n个元素,第一个编号为1。 |
| E:nth-of-type(n) | 与:nth-child()作用类似,但是仅匹配使用同种标签的元素 |
| E:nth-last-type(n) | 与:nth-last-child()作用类似,但是仅匹配使用同种标签的元素。 |
| E:last-child | 匹配父元素的最后一个子元素,等同于:nth-last-child(1) |
| E:first-of-type | 匹配父元素下使用同种标签的第一个子元素,等同于:nth-of-type(1) |
| E:last-of-type | 匹配父元素下使用同种标签的最后一个子元素,等同于:nth-last-of-type(1) |
| E:only-child | 匹配父元素下仅有的一个子元素,等同于:first-child:last-child或 :nth-child(1):nth-last-child(1) |
| E:only-of-type | 匹配父元素下使用同种标签的唯一一个子元素,等同于:first-of-type:last-of-type或 :nth-of-type(1):nth-last-of-type(1) |
| E:empty | 匹配一个不包含任何子元素的元素,注意,文本节点也被看作子元素 |
E:disabled, E:checked, E:not(s), E::selection:
E::selection只支持background和color属性。
E:target
其他