CSS高手请进,关于链接文字颜色的处理

phplover 2003-05-15 01:41:59
我想实现链接文字一般情况下显示为黑色,当鼠标在上方时,文字变成红色,并且有下划线。不管此链接是否已经访问过都是一样。下面代码为什么不行?

<style>
a:link{
color:#000000;text-decoration:none;
}
a:hover{
color:#ff0000;text-decoration:underline;
}
a:visited{
color:#000000;text-decoration:none;
}
a:active{
color:#666666;text-decoration:none;
}
</style>
<a href=test.htm>Test.htm</a>

刚才已经发了一帖,在
http://expert.csdn.net/Expert/topic/1787/1787358.xml?temp=.614773
但并没有显示在javascript版面上,斑竹为什么呀?
...全文
42 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Reker熊 2003-05-15
  • 打赏
  • 举报
回复
a.hover放在最後
dream_river 2003-05-15
  • 打赏
  • 举报
回复
<head>
<style>
a:visited{
color:#000000;text-decoration:none;
}

a:hover{
color:#ff0000;text-decoration:underline;
}

a:link{
color:#000000;text-decoration:none;
}
</style>
</head>

<a href=test.htm>Test.htm</a>
phplover 2003-05-15
  • 打赏
  • 举报
回复
哇,高手不同就是不同,果然一下就搞定
不过你的好像内容跟我的差不多,只是顺序有所改变,为什么结果会不同呢?能否解释一下!!!
fason 2003-05-15
  • 打赏
  • 举报
回复
<head>
<style>
a:link{
color:#000000;text-decoration:none;
}
a:visited{
color:#000000;text-decoration:none;
}
a:active{
color:#666666;text-decoration:none;
}
a:hover{
color:#ff0000;text-decoration:underline;
}
</style>
</head>

<a href=test.htm>Test.htm</a>
phplover 2003-05-15
  • 打赏
  • 举报
回复
去掉a:visited 的设置不行,没有访问的都有下划线了
搞搞儿的 2003-05-15
  • 打赏
  • 举报
回复
可去掉 a:visited 的设置
搞搞儿的 2003-05-15
  • 打赏
  • 举报
回复
对于已访问过的连接总是以 a:visited 的颜色显示

87,903

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧