Html 如何在IE7中删除链接周围的虚线边框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12007507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:18:01  来源:igfitidea点击:

how to remove dotted border around the link in IE7

htmlcssinternet-explorer-7

提问by Mo.

There is border around button and link when click.

单击时按钮和链接周围有边框。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

could anyone help me solution to remove it.

谁能帮我解决办法删除它。

采纳答案by Karl Laurentius Roos

It's ugly, but so are most IE fixes.

这很丑陋,但大多数 IE 修复程序也是如此。

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

回答by darma

You can preset it like that :

你可以这样预设:

:focus{
    outline:0; /*removes the dotted border*/
}

But remember (for accessibility reasons) to set the style "later" in your CSS file to something more visible. For example :

但请记住(出于可访问性原因)将 CSS 文件中的样式“稍后”设置为更明显的样式。例如 :

a:focus, a:active{
    color:#ff5500; /*different color than regular*/
}
input[type=submit]:focus, input[type=submit]:active{
    background-color:#444; /*different color than regular*/
}

回答by Mahadeva Prasad

Try this one

试试这个

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

回答by Chris

To start with, I can see one of your tags is IE7-bug, while this is actually more like a feature. The purpose of having this dotted outlineis for users to be able to navigate between various controls using their mousewheel or the tabkey.

首先,我可以看到你的一个标签是IE7-bug,而这实际上更像是一个功能。加点的目的outline是让用户能够使用鼠标滚轮或tab按键在各种控件之间导航。

In any case, to define the style of an element when it's "focused" use the CSS :focusselector. The property that styles this outline is, trivially, outline; outline: 0will prevent the focus outline from appearing.

在任何情况下,要定义元素在“聚焦”时的样式,请使用 CSS:focus选择器。为这个大纲设置样式的属性很简单,outline; outline: 0将阻止出现焦点轮廓。

Note:You might want to apply that rule only on your button, and not on all elements, because some users might be used to seeing something to indicate focus, which makes it easier to navigate using the methods mentioned above.

注意:您可能只想在您的按钮上应用该规则,而不是在所有元素上应用该规则,因为有些用户可能习惯于看到一些东西来指示焦点,这使得使用上述方法进行导航变得更加容易。

Hope that helped in any manner.

希望以任何方式提供帮助。

回答by Vojta Jemelka

CSS outlineis not supported in IE7. That "browser" requires the following CSS expression:

outlineIE7 不支持CSS 。该“浏览器”需要以下 CSS 表达式:

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

It works also in newer versions.

它也适用于较新的版本。

回答by maindola

a:link{ outline-style: none; }`

一个:链接{大纲样式:无;}`

回答by pwavg

This would do the trick

这可以解决问题

a {
   outline:0;
}

回答by PravinS

This will also work

这也将起作用

    a 
    {
        outline-style:none;
    }

回答by Andrew

Apply this rule to the input

将此规则应用于输入

input { outline : none ; }

回答by NewUser

Try

尝试

a {
     outline: none;
}

Always try to use css reset.This will help you to solve the problem like this.I use eric mayer css reset tool.

总是尝试使用css reset。这将帮助您解决这样的问题。我使用eric mayer css reset tool