css/JS/jquery三种方法去掉链接虚线框
9688 点击·0 回帖
![]() | ![]() | |
![]() | css: 兼容性很差。
代码如下 a:focus,input:focus {outline:none;} 在 Firefox 里可以用 -moz-outline:none; 或者 outline:none; 来将其去掉。所以我们可以这样写: 代码如下 a:focus { outline:none; -moz-outline:none; } 直接加: onfocus="this.blur()" 也可以利用htc文件加入a.style.behavior属性.如: 代码如下 <style> a,img { behavior:url(js文件地址); } </style> 在js文件中写入下面语句 代码如下 <attach event="onFocus" handler="onFocus" /> <SCRIPT language="javascript"> function onFocus() { this.blur(); } </SCRIPT> JQ的写法: 代码如下 $("input:not(input[type='text'],input[type='password'])").focus(function(){ this.blur(); }); | |
![]() | ![]() |