<html>
<head>
<style>
a:link {background-color: red; color: white;}
a:visited {background-color: yellow; color: black;}
a:hover {background-color: green; color: white;}
a:active {background-color: blue; color: white;}
</style>
</head>
<body>
<div>
<a href="http://a.link/">
链接的默认效果是a:link中的效果
</a>
</div>
<div>
<a href="">
访问过的链接的效果是a:visited中的效果
</a>
</div>
<div>
<a href="http://blog.csdn.net/hu_zhenghui">
鼠标移动到链接上的效果是a:hover中的效果
</a>
</div>
<div>
<a href="http://blog.csdn.net/hu_zhenghui">
鼠标单击链接时的效果是a:active中的效果
</a>
</div>
</body>
</html>
div+css处理链接的:link,:visited,:hover,:active四种状态
最新推荐文章于 2021-08-03 19:34:00 发布