IE7 outline:0 not working

2019-07-03 01:31发布

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?

4条回答
别忘想泡老子
2楼-- · 2019-07-03 02:04

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楼-- · 2019-07-03 02:11

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

查看更多
淡お忘
4楼-- · 2019-07-03 02:12

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");
    });
});
查看更多
来,给爷笑一个
5楼-- · 2019-07-03 02:14

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.

查看更多
登录 后发表回答