#12004/4/6 11:29:05
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a:link { font-family: "宋体"; font-size: 9pt; line-height: 12px; color: #FF0000; text-decoration: underline}
a:hover { font-family: "宋体"; font-size: 9pt; line-height: 12px; color: #0000FF; text-decoration: none}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<a href="index.asp">中国人</a>
</body>
</html>
上面的CSS代码运行时a:link部分不起作用,但a:hover部分却可能起作用,后经网友指点,将代码改为如下:
<html>
<head>
<title>中国人</title>
<style type="text/css">
<!--
a:link {font-size:9pt;color:#000000;text-decoration:none}
a:visited {font-size:9pt;color:#4455aa;text-decoration:underline}
a:hover {font-size:9pt;color:#990000;text-decoration:underline}
-->
</style>
</head>
<body>
<a href="index.asp">中国人</a>
</body>
</html>
这下子完全正常了,与上面的代码相比,增加了a:visited部分,如果去掉这项就显示不正常了,请教各位这是为何?a:visited 表示访问过的链接状态,为何非得要加上这一项才能正常显示呢?百思不得其解。我还曾测试过,只用上a:link一项也没用,运行时并不能实现所需效果,再加上a:visited这项就正常显示了,还有我最上面的写法只有a:link及a:hover两项也是没用的,哪位给详细指点一下好吗?或者推荐一篇详细的教程,我看过几篇教程,都没有提到为何不加上a:visited项就不起作用的原因,但有一位网友曾用我最上面写的代码测试了一下却是完全正常的(我当时就浏览过他的测试网页,的确正常呀,但在我的机子上却不行了,我的Web服务器是IIS5.0,运行并没有问题呀,但不知为何,同样的代码在他的服务器上可以,在我的服务器上却不行,实在难以理解其中原因)。静候大家的指点,谢谢。