css伪类选择器链接伪类:设置鼠标移动到链接颜色等
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
a:link {
color: #333;
text-decoration: none;
}
a:visited {
color: rgb(216, 6, 6);
}
a:hover {
color: rgb(9, 241, 125);
}
a:active {
color: rgb(240, 4, 240);
}
</style>
</head>
<body>
<a href="#">第一个链接</a>
<a href="http:/www.qq.com">鹅厂官网</a>
</body>
</html>
- a:link :未访问过链接 选择未访问过链接
- a:visited:点击选择已经访问过链接
- a:hover:选择鼠标经过的链接
- a:active: 选择鼠标正在按下还没有弹起鼠标的链接
注意:一定要按照这个顺序来写,为了确保生效,可以用love and hate帮助记忆