1、动态伪类
.dynamic:link {
}
.dynamic:visited {
}
.dynamic:hover {
}
.dynamic:active {
}
.dynamic:focus {
}
2、目标伪类
p:target {
background: yellow
}
.element-box[type='checkbox']:checked {
background: red
}
.element-input[type='text']:enabled {
background: green
}
.element-input[type='text']:disabled {
background: yellow
}
3、语言伪类
<p lang="en">Ceci est un paragraphe.</p>
:lang(en) {
background: red;
}
4、元素伪类选择器
.icon::before {
content: url('https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=591053194,1384024618&fm=26&gp=0.jpg');
margin-right: 5px;
vertical-align: middle
}
.welcome::before {
content: attr(data-username)
}
5、结构伪类
.construction-box section:nth-child(4) {
}
.construction-box section:nth-last-child(3) {
}
.construction-box section:nth-of-type(4) {
}
.construction-box section:nth-of-type(1) {
}
.construction-box section:only-child {
}
.construction-box section:only-of-type {
}
:root {
}
.construction-box p:empty {
}
6、排除伪类
.construction-box section:not(.aaa) {
color: red
}