CSS伪类选择器
:link | a:link | 选择所有未被访问的链接。 |
---|---|---|
:visited | a:visited | 选择所有已被访问的链接。 |
:active | a:active | 选择活动链接。 |
:hover | a:hover | 选择鼠标指针位于其上的链接。 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
a:link{ #默认第一次时
color: red;
}
a:visited{ #访问过时
color: green;
}
a:hover{ #键盘停留时
color: blue;
}
a:active{ #点击不松开时
color: pink;
}
</style>
</head>
<body>
<a href="">点击</a>
</body>
</html>