只在a的标签里写上如下样式:
a{blr:expression(this.onFocus=this.blur()); outline:none;}
上一篇:网页256颜色色值(码)参考
讨论数量:2
纯CSS去掉超链接或按钮点击时出现的虚线边框
<style type="text/css">
a,input,button{ outline:none; }
::-moz-focus-inner{border:0px;}
</style>
</head>
<body>
<a href="http://www.hilo8.com" target="_blank">hilo8.com</a>
<input type="button" value="hilo8.com"/>
<button>hilo8.com</button>
</body>
从以上代码可以看出,可以通过设置CSS属性outline解决。
FF存在bug,其中input,button标签通过私有属性::-moz-focus-inner特别处理
以上方法在IE6、IE7下无效。可使用 onfocus 属性解决,如下:
<a href="http://www.hilo8.com" target="_blank" onfocus="this.blur()">hilo8.com</a>