最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
A标签虚线框去掉3种方法(CSS/JS/jquery)
时间:2014-08-29 编辑:简简单单 来源:一聚教程网
1. CSS方式去掉链接虚线框的方法:
在IE下是使用html属性:hideFoucs,在HTML标签中加上hidefocus=”true” 属性即可,但这个属性是IE私有的,Firefox是不认的。
IE中用CSS处理:
a{noOutline:expression(this.onFocus=this.blur());}/
* "onFocus" 注意大小写*/
Firefox的处理方法比较符合标准,只需要在CSS样式代码里设置a:focus
{outline:none}皆可。接下来看一下MSIE和FF中统一处理的方法:
a{
outline:none; /*FF*/
noOutline:ex
pression(this.onFocus=this.blur());/*IE*/
}
css htc文件处理
a {behavior:url("htc文件")}
考虑性能优化,可参考以下代码:
a{outline:none;}
a:active{noOutline:expression(this.onFocus=this.blur());}
:focus{outline:0;}
2. 用js方式解决链接虚框的方法:
利用javascript的onfocus事件,实现如下:
JQ的写法:
$("input:not(input[type='text'],input[type='password'])").focus(function(){
this.blur();
});
-
下一个: javaScript判断函数是否存在
相关文章
- css/JS/jquery三种方法去掉链接虚线框 12-22
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31