超链接伪类选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document
</title>
<style>
a:link {
font-size: 16px;
color: darkblue;
font-weight: 700;
}
a:visited {
color: yellow;
}
a:hover {
color: red;
}
a:active {
color: gray;
}
</style>
</head>
<body>
<div>
<a href="http://www.hao123.com">抢购
</a>
<a href="http://www.ganji.com">秒杀
</a>
</div>
</body>
</html>
结构伪类选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document
</title>
<style>
li:first-child {
color: blue;
}
li:last-child {
color: green;
}
</style>
</head>
<body>
<ul>
<li>aaaaa
</li>
<li>bbbbbb
</li>
<li>ccccc
</li>
<li>ddddddddd
</li>
<li>eeeeee
</li>
<li>ffffff
</li>
</ul>
<ul>
<li>aaaaa1
</li>
<li>bbbbbb1
</li>
<li>ccccc1
</li>
<li>ddddddddd1
</li>
<li>eeeeee1
</li>
<li>ffffff1
</li>
</ul>
</body>
</html>
伪类 —— 菜鸟教程详解
返回CSS选择器
转载请注明原文地址: https://win8.8miu.com/read-6173.html