我是新手学习网络开发。以下是我的test.html文件和test.css以下代码段中的文件。
现在,我有最新的 Mozilla firefox (66.0.5) 和 Chrome (74.0.3729.131) 浏览器。我在 Firefox 中设置永远不会记住历史。但是 Chrome 具有记住历史的设置。当我打开时test.html,链接颜色在 Firefox 中显示为红色,在 Chrome 中显示为蓝色。单击链接不会改变这些浏览器中的颜色。那么这种行为的原因是什么,我如何让链接只有在点击后才变成蓝色?
/* give red color to web link */
a {
color: red ;
}
/* give blue color to the link after its
visited */
a:visited {
color: blue ;
}Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="test.css">
</head>
<body>
<a href="http://www.google.com">Go to Google !</a>
</body>
</html>Run Code Online (Sandbox Code Playgroud)