a.
伪类是用来添加一些选择器的特殊效果
b.anchor伪类--链接的不同状态都可以以不同的方式显示
a:link {color:#FF0000;}
a:visited {color:#00FF00;}
a:hover {color:#FF00FF;}
a:active {color:#0000FF;}
c.伪类和CSS类
a.red:visited {color:#FF0000;}
:first-child 伪类--可以使用 :first-child 伪类来选择父元素的第一个子元素。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>伪类(Pseudo-classes)</title>
</head>
<style>
a.red:visited {
color: #FF0000;
}
a:first-child {
color: yellow;
}
</style>
<body>
<a href="#">hello</a>
<a href="javascript:void(0);">hello</a>
<a href="javascript:void(0);">hello</a>
<a href="javascript:void(0);">hello</a>
<a class="red" href="css-syntax.html">CSS 语法</a>
</body>
</html>