<script>
function addfavorite()
{
if (document.all)
{ window.external.addFavorite('http://www.ijavascript.cn',ijavascript.cn');); }
else if (window.sidebar)
{ window.sidebar.addPanel('Dnew.cn', 'http://www.ijavascript.cn', ""); }

</script>

解决方案 »

  1.   

    注意:为了产生预期的效果,在 CSS 定义中,a:hover 必须位于 a:link 和 a:visited 之后!!
    注意:为了产生预期的效果,在 CSS 定义中,a:active 必须位于 a:hover 之后!!你即使不是动态产生的超链接也有你说的那个问题。
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script language="javascript" type="text/javascript">
    function tt()
    {
     document.getElementById("t").innerHTML = " <a href='javascript:void(0);' >test </a>";
    }
    </script>
    <style type="text/css">
    a:link {color:#339966}     /* 未访问的链接 */
    a:visited {color:#996633}  /* 已访问的链接 */
    </style>
    </head><body>
    <div>
    <a href="#">hahaa</a>
    <input type="button" onclick="tt()" value="test" />
    </div>
    <div id="t" ></div>
    </body>
    </html>刚才看hao123的源码其中指定超链接部分:
    a:link, a:visited{color:#000;text-decoration:none}
    a:active{color:green;text-decoration:none}
    a:hover{color:red;text-decoration:underline}参考下。
    之前好像没注意这个问题。