纯CSS去掉超链接或按钮点击时出现的虚线边框
<style type="text/css"> a,input,button{ outline:none; } ::-moz-focus-inner{border:0px;} </style>
从以上代码可以看出,可以通过设置CSS属性outline解决。
FF存在bug,其中input,button标签通过私有属性::-moz-focus-inner特别处理
以上方法在IE6、IE7下无效。可使用 onfocus 属性解决,如下:
<a href="http://www.admin10000.com" target="_blank" οnfοcus="this.blur()">admin10000.com</a>
使用jquery方法只需一句,非常简单,支持所有浏览器
$("a,input,button").focus(function(){this.blur()});