css之伪类选择器
伪类选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style type="text/css">
/*h1:hover{*/
/* color: red;*/
/*}*/
.myclass:hover{
color: blue;
}
/*设置静止状态*/
a:link{
color: yellow;
}
/* 设置鼠标悬浮状态*/
a:hover{
color: red;
}
/* 设置鼠标触发状态 */
a:active{
color: blue;
}
/* 设置鼠标完成状态 */
a:visited{
color: green;
}
</style>
<body>
<!--
伪类选择器:
向某些选择器添加特殊效果
一般伪类选择器上都是用在超链接上
-->
<a href="https://www.baidu.com">aaaa</a>
<h1 class="myclass">我是标题</h1>
</body>
</html>
本文来自博客园,作者:King-DA,转载请注明原文链接:https://www.cnblogs.com/qingmuchuanqi48/articles/17170153.html

浙公网安备 33010602011771号