zoukankan      html  css  js  c++  java
  • IE去掉链接虚线框的几个方法

    虚线框简直就是个多余的东西,上一篇教大家怎么去除Firefox中链接和按钮虚线框,今天叫大家去掉去除IE中链接的虚线框。
    方法一:利用javascript的onfocus事件,实现如下:
    Html代码

    <a href="http://www.hujuntao.com/" onfocus="this.blur();">设计蜂巢</a>

    如果引入了jQuery框架则可以利用它的事件绑定机制:

    Js代码

    $('a').bind('focus', function(){   
        if(this.blur){ //如果支持 this.blur   
            this.blur();   
        }   
    });

    方法二:利用css样式,实现如下:

    Css代码  
    a{  
        blr: expression(this.onFocus=this.close());  
    } /* 只支持IE,过多使用效率低 */  
    a{  
        blr: expression(this.onFocus=this.blur());  
    } /* 只支持IE,过多使用效率低 */  
    a:focus {   
        -moz-outline-style: none;   
    } /* IE不支持 */  
    :focus {   
        outline: none;   
    } /* for Firefox */

    方法三:利用标签属性,仅支持IE,实现如下:

    Html代码

    <a href="http://www.hujuntao.com/" hidefocus="true">设计蜂巢</a>

    方法四:HTC 实现如下:
    将一下代码保存为.htc后缀的文件

    Js代码

    <public:attach event="onfocus" onevent="quit()" />   
    <script language="javascript">   
        function quit(){   
            this.blur();   
        }   
    </script>

    CSS代码

    a {behavior:url("htc文件")}
  • 相关阅读:
    (critical) chassis-frontend.c:122: Failed to get log directory, please set by --log-path
    Zabbix MySQL percona 模板部署
    shell编程
    pt-online-schema-change
    Haproxy + Keepalived +PXC 常见错误
    c/c++获取系统时间函数
    《C++ Concurrency in Action》
    C++多线程学习资料参考
    C++11多线程教学
    软件学习网站
  • 原文地址:https://www.cnblogs.com/chris-oil/p/3355865.html
Copyright © 2011-2022 走看看