<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>a:link:visited:focus:hover:active</title>
<style>
/*参考:https://blog.csdn.net/xiaoxiao20121314/article/details/81103500*/
/*:link向未访问的链接添加特殊的样式。
注意: :link 选择器对已经访问的链接没有样式。*/
a:link {
color: orange;
text-decoration: none;
}
/*:visited选择器设置访问过的页面链接的样式。*/
a:visited {
color: red;
}
/*:focus选择器,设置链接获取焦点时的样式。可以按Tab键测试。*/
a:focus {
font-weight: bolder;
}
/*:hover选择器当有鼠标悬停在其上的链接样式。*/
a:hover {
color: green;
}
/*:active选择器设置当你点击链接时的样式。*/
a:active {
font-size: large;
}
</style>
</head>
<body>
<a id="myAnchor" href="//www.runoob.com">访问菜鸟教程</a>
</body>
</html>
css a标签:link:visited:focus:hover:active.html
最新推荐文章于 2021-08-10 14:10:54 发布