网页制作 如何去除链接虚线

<a fref="http//www.mmorpg-depot.com">www.mmorpg-depot.com</a>这个链接 去掉点击后链接的虚线 代码应该怎么写呢以前记得 现在好像忘记了这个html 代码该如何写呢

第1个回答  2012-09-02
局部控制

<a href="link1.htm" onfocus="this.blur()">link1</a>

<a href="link1.htm" onfocus="this.close()">link1</a>

<a href="link1.htm" hidefocus="true">link1</a>

<a href="link1.htm" hidefocus="hidefocus">link1</a>

全局控制 

CSS实现

a{blr:expression(this.onFocus=this.close());} /* 只支持IE,过多使用效率低 */

a{blr:expression(this.onFocus=this.blur());} /* 只支持IE,过多使用效率低 */

a:focus { -moz-outline-style: none; } /* IE不支持 */

HTC实现 IE支持,页面载完才有效果

把下面这段代码存为.htc为扩展名的文件
<public:attach event="onfocus" onevent="hscfsy()"/>
<script language="javascript">
function hscfsy(){
this.blur();
}
</script>

调用 a {behavior:url(htc文件所在路径地址)}

JS遍历实现
window.onload=function()
{
for(var ii=0; ii<document.links.length; ii++)
document.links[ii].onfocus=function(){this.blur()}
}

JS封装为函数 function fHideFocus(tName){
aTag=document.getElementsByTagName(tName);
for(i=0;i<aTag.length;i++)aTag[i].hideFocus=true;
//for(i=0;i<aTag.length;i++)aTag[i].onfocus=function(){this.blur();};
}
相似回答