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

来源:互联网 发布:长郡 雅礼 知乎 编辑:程序博客网 时间:2024/06/03 02:54

第一种:

可以在每个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>

0 0