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

第一种:

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

 

 

posted on 2012-06-19 18:28  小落落  阅读(1456)  评论(0编辑  收藏  举报