您的位置:首页 > 其它

关于去掉a标签点击后的虚线框问题

2012-06-19 18:28 295 查看
第一种:

可以在每个a标签上加blur(),缺点:Tab键会失效

第二种:在css中加expression

第三种:用IE自带的属性hidefocus来兼容IE浏览器

三种方法的具体代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>N!</title>
<style>
body .a{outline:none;blr:expression(this.onFocus=this.blur());}
</style>
</head>
<body>
<a href="#" onfocus="this.blur();">blur方法</a>
<a class="a" href="#" >css法</a>
<a href="#" hidefocus="true" style="outline:none;" >IE下hidefocus法,ff等outline法</a>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: