我想在下面的脚本中将超链接的默认蓝色更改为绿色,但我不断收到粉红色链接。如何在html中更改链接的默认颜色? (a:链接)
你能让我知道如何在链接没有被点击时将它变成绿色?提前致谢。
我所寻找的是这样的:
- a)拥有,当它没有被点击尚未
- B A绿色链接)有一个红色的链接,当鼠标悬停在链接
- C)有一个黄色链接,当鼠标点击该链接
- d)当有后的链接被点击一个粉红色的链接
<!DOCTYPE html>
<html>
<head>
<style>
a:link {
color: green;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: pink;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: red;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
</style>
</head>
<body>
<p>You can change the default colors of links</p>
<a href="http://www.w3schools.com/html/html_images.asp"
target="_blank">HTML Images</a>
</body>
</html>
如果您是从网上复制的学校代码,只需使用他们提供的演示:http://www.w3schools.com/css/css_link.asp – wlh
的问题是演示本身带有错误♣♦ – T100
我认为你的代码可能很好。它为我工作。但是你需要明白,当你点击链接时链接不会变成粉红色,如果有人已经访问了页面,那么它会变成粉红色。所以如果你去过这个页面,它会变成粉红色的。 – StephenCollins