通过伪类选择器调整链接属性

来源:互联网 发布:plc和单片机有什么区别 编辑:程序博客网 时间:2024/05/22 05:07
<!doctype html>
<!--利用伪类选择器设置链接的属性参数-->
<html>
<head>
<meta http-equiv="charset" content="UTF-8">
<title>测试页</title>
<style>
a.a1:link{
font-family:"微软雅黑";
font-size:10px;
text-decoration:overline;
color:blue;
}
/*伪类选择器直接改变a1类的link属性*/
a.a1:hover{
color:red;
}
/*伪类选择器直接改变a1类的hover属性*/
a.a2:link{
font-family:"宋体";
font-size:19px;
text-decoration:none;
color:black;
}
a.a2:hover{
color:yellow;
}
a.a3:link{
font-family:"楷体";
font-size:20px;
text-decoration:line-through;

color:green;
}
a.a3:hover{
color:pink;
}
</style>
</head>
<body>
<a href="http://www.baidu.com" class="a1">链接1&nbsp&nbsp</a>
<a href="http://www.baicu.com" class="a2">链接2&nbsp&nbsp</a>
<a href="http://www.baidu.com" class="a3">链接3&nbsp&nbsp</a>
</body>
</html>
原创粉丝点击