最终实现效果:点击前蓝色,点击后其他颜色,刷新恢复蓝色
为什么我下面的代码不能实现这个呀,我看了代码好像没问题,请教大虾们帮我解困。<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <style>
    a:link.other {color:#000000;text-decoration:none}      /* 未被访问的链接      没有下划线*/
a:visited.other {color:#cccccc;text-decoration:none}   /* 已被访问过的链接    没有下划线*/
a:hover.other {color: #000000;text-decoration:none}    /* 鼠标悬浮在上的链接  下划线为underline 上划线为overline 无下划线为none*/
a:active.other {color: #000000;text-decoration:none}    /* 鼠标点中激活链接    没有下划线*/
  </style>
 </HEAD> <BODY> 
  <table width="780" border="0" cellspacing="0" cellpadding="0">
<tr height="28">
<td class="other"><a href="WWW.126.COM">AAA</a> | </td>
<td class="other"><a href="WWW.BAIDU.COM" >BBB</a> | </td>
<td class="other"><a href="WWW.GOOGLE.CN" >CCC</a> | </td>
</tr>
</table>
 </BODY>
</HTML>

解决方案 »

  1.   

    lovhate红色字母顺序书写css,
    反正这个是有特定的顺序的,css权威指南上就有,可能记得有误a.other:visited 应该是这样写吧.
      

  2.   

    不知道!你设置一下颜色呀不同呀a:link.other a:hover.other  a:active.other a:visited.other中.other 去掉!
      

  3.   

    这个应该没问题,已测试。<HTML>
    <HEAD>
      <TITLE> New Document </TITLE>
      <style>
        a.other:link {color:blue;text-decoration:none}    /* 未被访问的链接      没有下划线*/
    a.other:visited {color:green;text-decoration:none}  /* 已被访问过的链接    没有下划线*/
    a.other:hover {color:yellow ;text-decoration:none}  /* 鼠标悬浮在上的链接  下划线为underline 上划线为overline 无下划线为none*/
    a.other:active {color:pink;text-decoration:none}  /* 鼠标点中激活链接    没有下划线*/
      </style>
    </HEAD><BODY>
    <a href="www.google.com" class="other" target="_blank">AAA </a>
    </BODY>
    </HTML> 
      

  4.   

     呵呵  自己琢磨出来了。 分享出来:<HTML> 
    <HEAD> 
      <TITLE> New Document </TITLE> 
      <style> 
    a{color:#000;text-decoration:none}      /* 未被访问的链接      没有下划线*/
    a:hover{color:#515561;}    /* 鼠标悬浮在上的链接  下划线为underline 上划线为overline 无下划线为none*/
    a.hov {color:#515561;} /* 访问后 自定义灰色      没有下划线*/
      </style> 
    </HEAD> <BODY> 
    <table width="780" border="0" cellspacing="0" cellpadding="0"> 
    <tr height="28"> 
    <td class="other"> <a href="WWW.126.COM"   class="" onclick="className='hov'" target="_black">AAA </a> | </td> 
    <td class="other"> <a href="WWW.BAIDU.COM" class="" onclick="className='hov'" target="_black" >BBB </a> | </td> 
    <td class="other"> <a href="WWW.GOOGLE.CN" class="" onclick="className='hov'" target="_black">CCC </a> | </td> 
    </tr> 
    </table> 
    </BODY> 
    </HTML>
      

  5.   

    你这个没有3楼的好,因为 a的class='other' 无效,你这个定义所有a标签的样式,如果a,有两个不同的样式的话,你这个就麻烦了.