CSS 如何在 IE9 中删除链接周围的蓝色边框?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10284954/
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-30 03:41:36  来源:igfitidea点击:

how to remove blue border around links in IE9?

cssinternet-explorer

提问by user1341808

I'm working on this site: http://amberdreams.com

我在这个网站上工作:http: //amberdreams.com

This is a pretty simple site, and I've been using netrenderer.com to make sure that all the pages work in Internet Explorer.

这是一个非常简单的站点,我一直在使用 netrenderer.com 来确保所有页面都可以在 Internet Explorer 中运行。

Despite my best efforts, I have not been able to remove the blue border around the facebook and twitter links on the home page for this site when viewing it with Internet Explorer 9.

尽管我尽了最大的努力,但在使用 Internet Explorer 9 查看该站点时,我还是无法删除该站点主页上 facebook 和 twitter 链接周围的蓝色边框。

img {border: none; }
a img {border: 0px; }

I've tried variations of the code above, and it successfully removes the blue border for every version of IE except 9. Any ideas?

我已经尝试了上面代码的变体,它成功地删除了除 9 之外的每个版本的 IE 的蓝色边框。有什么想法吗?

回答by Andy

Try this in your CSS, worked for me.

在你的 CSS 中试试这个,对我有用。

img {text-decoration: none; border: 0px}

回答by user1270235

I think that should be fine.

我觉得应该没问题。

You might want to clear your cache and try again...

您可能想清除缓存并重试...

If not maybe try:

如果没有,请尝试:

a{border:none}

回答by tajhamille

Try the following instead in your css:

在您的 css 中尝试以下操作:

border-style:none;

That should remove your border issue.

那应该消除您的边界问题。

回答by Teemu

Visibility of the border around links depends on user settings in IE. Set A {text-decoration: none; border: 0px}.

链接周围边框的可见性取决于 IE 中的用户设置。设置A {text-decoration: none; border: 0px}

It seems, that your video-object is not loaded in IE.

看来,您的视频对象未在 IE 中加载。

回答by Yuri Kovzel

Here is great post on removing outlinewith separate remark about IE9:

这是关于删除大纲的好帖子,并附有关于 IE9 的单独评论:

George Langley wrote in to say that IE 9 apparently doesn't allow you to remove the dotted outline around links unless you include this meta tag:

George Langley 写道,IE 9 显然不允许您删除链接周围的虚线轮廓,除非您包含此元标记:

<meta http-equiv="X-UA-Compatible" content="IE=9" />

回答by Silverman

//Add to your CSS

//添加到你的CSS

* {-ms-box-sizing:border-box;}
img {outline-style: none;}

//Add to your HTML

//添加到你的HTML

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>

回答by NoWomenNoCry

in my case the working code (generated by mailchimp and added a rule for 'a') was:

在我的情况下,工作代码(由mailchimp生成并为“a”添加了规则)是:

img,a img,a{
    border:0;
    height:auto;
    outline:none;
    text-decoration:none;
}

so it is an assumption of other answers

所以这是其他答案的假设

回答by Silverman

The best way is to add a CSS attribute

最好的方法是添加一个 CSS 属性

a:link, a:visited { text-decoration: none}

If you want to change colors when you hover the mouse, add

如果要在鼠标悬停时更改颜色,请添加

a:hover {color: x } // x = the color of your choice