IE7 outline:0 not working

江枫思渺然 提交于 2019-12-13 14:17:55

问题


I understand the the outline is used for accessibility but what's another way of doing:

a {
   outline: 0;
}

something that works in IE7

using Jquery perhaps?


回答1:


For jquery you can try something like this

$('a').focus(function() {
  $(this).blur();
});

It's essentially the same thing as the IE 7 only solution, it says when anchor is focused, blur it. I tried this on Mac VM IE 7 and it works

http://jsfiddle.net/QnMLR/2/

the top one has the outline and bottom one does not




回答2:


now used to focus

a:hover, a:active, a:focus{
outline:0;
}

more info http://css-tricks.com/removing-the-dotted-outline/


Updated ie solution is

a:focus, *:focus {
    noFocusLine: expression(this.onFocus=this.blur());
}

more info http://www.cssjunction.com/css/remove-dotted-border-in-ie7/




回答3:


This works as well using jquery and doesn't mess up the tab order:

$(function ()
{
    $("a").each(function() {
        $(this).attr("hideFocus", "true").css("outline", "none");
    });
});



回答4:


I think the _noFocusLine do work in IE7

a{
    outline: none;
    _noFocusLine: expression(this.hideFocus=true);
}

I found this from here , and I have tried it by myself. Hope this will help you.



来源:https://stackoverflow.com/questions/11360979/ie7-outline0-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!