去掉点击链接时周围的虚线框outline属性
2014-08-18 17:44
169 查看
1.
CSS方式
在IE下是使用html属性:hideFoucs,在HTML标签中加上hidefocus=”true” 属性即可,但这个属性是IE私有的,Firefox是不认的。
<a href="#" hidefocus="true" title="加了hidefocus" >加了hidefocus属性</a>
IE中用CSS处理的方式为:
a{noOutline:expression(this.onFocus=this.blur());}/*
"onFocus" 注意大小写*/
Firefox的处理方法比较符合标准,只需要在样式里设置a:focus{outline:none}皆可:
a:focus{outline:none}
MSIE和FF中的统一处理方法:
a{
outline:none; /*FF*/
noOutline:expression(this.onFocus=this.blur()); /*IE*/
}
考虑性能优化:
a{outline:none;}
a:active{noOutline:expression(this.onFocus=this.blur());}
:focus{outline:0;}
2.
js方式
$("a").bind("focus",
function(){
if(this.blur){
this.blur();
}
});
转自E世年华的博客
原文链接:http://www.cnblogs.com/ango001/articles/2195718.html
CSS方式
在IE下是使用html属性:hideFoucs,在HTML标签中加上hidefocus=”true” 属性即可,但这个属性是IE私有的,Firefox是不认的。
<a href="#" hidefocus="true" title="加了hidefocus" >加了hidefocus属性</a>
IE中用CSS处理的方式为:
a{noOutline:expression(this.onFocus=this.blur());}/*
"onFocus" 注意大小写*/
Firefox的处理方法比较符合标准,只需要在样式里设置a:focus{outline:none}皆可:
a:focus{outline:none}
MSIE和FF中的统一处理方法:
a{
outline:none; /*FF*/
noOutline:expression(this.onFocus=this.blur()); /*IE*/
}
考虑性能优化:
a{outline:none;}
a:active{noOutline:expression(this.onFocus=this.blur());}
:focus{outline:0;}
2.
js方式
$("a").bind("focus",
function(){
if(this.blur){
this.blur();
}
});
转自E世年华的博客
原文链接:http://www.cnblogs.com/ango001/articles/2195718.html
相关文章推荐
- a:focus{outline: none;} 如何去掉点击链接时周围的虚线框outline属性
- 如何去掉点击链接时周围的虚线框outline属性
- 【转】去掉点击链接时周围的虚线框outline属性
- 去掉点击链接时周围的虚线框outline属性
- 去掉点击链接时周围的虚线框outline属性
- 如何去掉点击链接时周围的虚线框outline属性 去除a标签边上的虚线
- 去掉点击链接时周围的虚线框outline属性
- a:focus{outline: none;} 如何去掉点击链接时周围的虚线框outline属性
- 如何去掉点击链接时周围的虚线框outline属性
- 去掉链接点击后周围虚线框
- 如何去掉点击链接时周围的虚线框
- 去掉IE和Firefox下点击链接时的焦点虚线框
- 如何去掉点击a链接时周围的虚线框
- css 点击超级链接时,去掉周围的虚线框
- 如何去掉点击链接时周围的虚线
- 去掉图片链接点击后,图片周围的虚线框
- 去掉点击链接时周围的虚线框及未点击时的蓝色框
- 去掉点击链接时的虚线框
- 去掉点击链接时的虚线框
- 去掉图片链接点击后,图片周围的虚线框