a 伪类使用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>伪类使用</title>
<style type="text/css">
<!--
a:link {
	color:red;
}
a:visited {
	color: green;
}
a:hover {
	color: blue;
}
a:active {
	color: yellow;
}
-->
</style>
</head>

<!-- 
   锚伪类
   a:link{color:#FF0000}
   a:visited{color:#00FF00}  已访问的链接
   a:hover{color:#0000FF}    鼠标移动到链接上
   a:active{color:#00FF00}    选定的链接
-->

<body>
  <a href="test.html" target="_blank">跳转到2.html</a>
  <p>注:在css定义中,a:hover必须位于a:link和a:visited之后才能生效,a:active必须位于a:hover之后,才能生效</p>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
a.one:link {
	color: #FF0000;
}
a.one:visited{ color:#0066CC;}
a.one:hover{ color:#FF99CC;}

a.two:link {
	color: #FF0000;
}
a.two:visited{ color:#0066CC;}
a.two:hover{ font-size:large;}

a.three:link {color: #FF0000;}
a.three:visited{ color:#0066CC;}
a.three:hover{ background-color:#33CCCC}

a.four:link {color: #FF0000;}
a.four:visited{ color:#0066CC;}
a.four:hover{ font-family:Georgia, "Times New Roman", Times, serif}

a.five:link {color: #FF0000; text-decoration:none}
a.five:visited{ color:#0066CC; text-decoration:none}
a.five:hover{
	text-decoration: underline;
}
-->
</style>
</head>



<body>
  <a class="one" href="1.html"  target="_blank">这个链接改变颜色</a><br/>
  <a class="two" href="1.html"  target="_blank">这个链接改变大小</a><br/>
  <a class="three" href="1.html"  target="_blank">这个链接改变背景色</a><br/>
  <a class="four" href="1.html"  target="_blank">这个链接改变字体风格</a><br/>
  <a class="five" href="1.html"  target="_blank">这个链接加下划线</a>
</body>
</html>




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值