方法一: 定义样式outline:none即可,但此法只适应于FF,IE不支持,在IE 下可使用其私有的html属性:hideFoucs,在标签的结构中加入 hidefocus=”true” 属性。
- <a href= "#" hidefocus= "true" >这里放置您需要的文字或图片</a>
<a href="#" hidefocus="true">这里放置您需要的文字或图片</a>
方法二: 针对于IE
- .HideFocus {
- hide-focus: expression(this.hideFocus=true); /* for ie 5 + */
- outline: none; /* for firefox 1.5 + */}
.HideFocus {
hide-focus: expression(this.hideFocus=true); /* for ie 5+ */
outline: none; /* for firefox 1.5 + */}
但是expression性能极差,如果不是特别需求,全部页面链接点击所产生的虚线框都必须去掉,尽量不要用这种方法。
/*清除a链接过后的虚线*/
a:active, a:focus {-moz-outline:none;outline:none;ie-dummy:expression(this.hideFocus=true);}