去掉链接、按钮的虚框

来源:互联网 发布:游戏自动签到软件 编辑:程序博客网 时间:2024/04/20 15:51

链接和按钮在点击的时候会默认出现虚框,有时候因为美观我们需要去掉,最近就被这个小折腾了下,总结了下往上发的一些方法。
1、a{outline:none} 这个是针对Firefox的,但是IE下无效。
2、jQuery(“a”).each(function(){this.onmouseup = this.blur();})如果网站中已经加入jQuery,可以用这个方法。
3、< a href="#" hidefocus="true">……,在a标签中加入hidefocus=”true”,这个在IE下可用,但是通不过W3C验证。
4、< input type="button" border=0 onFocus="this.blur()" name="……"> button按钮标签中加入onFocus=”this.blur()”,这个同样无法通过w3c验证。
5、input{blr:expression(this.onFocus=this.blur());}给按钮加入这个样式,往上评论说这个东西不能多用,会影响性能,我也没验证,我只在一个地方用到。
上面的方法都可行,在使用时须看实际情况针对使用。

原创粉丝点击