Html 即使我禁用了所有相关的 CSS,我网站上链接下的蓝线?

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

Blue lines under links on my site even though I've disabled all related CSS?

htmlcssgoogle-chromehyperlinktext-decorations

提问by Brandon Wamboldt

Click here to see the issue

点击这里查看问题

I've tried disabled text-decoration, outlines, borders, and everything else I can think of. Using the inspect tool I cannot find anything that would cause these blue lines.

我尝试过禁用文本装饰、轮廓、边框以及我能想到的所有其他功能。使用检查工具我找不到任何会导致这些蓝线的东西。

This issue does not affect Firefox.

此问题不会影响 Firefox。

The text with the blue underline is a spaninside of an anchor tag.

带有蓝色下划线的文本是span锚标记的内部。

回答by Pavel Donchev

You seem to have this problem: http://www.google.com/support/forum/p/Chrome/thread?tid=44100701f93d5951&hl=en

你似乎有这个问题:http: //www.google.com/support/forum/p/Chrome/thread?tid=44100701f93d5951&hl=en

When you press F12 and inspect the elements affected, you should notice this:

当您按 F12 并检查受影响的元素时,您应该注意到这一点:

a:-webkit-any-link{
...
text-decoration: underline;
}

So maybe adding a stylesheet like this:

所以也许添加一个这样的样式表:

a:-webkit-any-link{
text-decoration:none !important;
}

UPDATE : I reproduced it and the above stylesheet, added to your main.css file worked. No need of two ":", it was a typo probably.

更新:我复制了它和上面的样式表,添加到你的 main.css 文件中。不需要两个“:”,这可能是一个错字。

Anyway it solved the problem on my PC, try to add it to your main.css and it should work. Thanks!

无论如何它解决了我电脑上的问题,尝试将它添加到你的 main.css 中,它应该可以工作。谢谢!

回答by Logesh Paul

Chirs Felstead solution resolve your issue with the first link you shared. (http://imgur.com/81MLR)

Chirs Felstead 解决方案通过您分享的第一个链接解决了您的问题。( http://imgur.com/81MLR)

For removing the blue underline here (http://akoostix.titanlabs.ca/?service=customers#home_page_news_section)

删除此处的蓝色下划线(http://akoostix.titanlabs.ca/?service=customers#home_page_news_section

introduce text-decoration to the below line

将文本装饰引入以下行

#front_page_services #service_operators {
  text-decoration: none;
}

in line no. 51 on front-page-services.css

行号 51 上front-page-services.css

回答by Michael Durrant

The standard way is:

标准方法是:

a {
    text-decoration: none;
}

Please explain more about the span inside an anchor as that sounds backwards. should be anchor inside span.

请解释更多关于锚内跨度的信息,因为这听起来倒退。应该在跨度内锚定。

回答by Teemu Ikonen

Define style like this:

像这样定义样式:

#front_page_services a {
    text-decoration: none;
}

回答by Kamyar

Use the text-decorationattribute on you anchor element, not span.

使用text-decoration锚元素上的属性,而不是跨度。

<a id="service_managers" href="http://akoostix.titanlabs.ca/services/managers" style="
text-decoration: none">

Tested on your page and it works.

在您的页面上进行了测试,并且可以正常工作。

回答by Chris Felstead

In your global.cssis the entry

在您的global.css是条目

a:hover { 
    color: #4E76C9; 
    text-decoration: underline; /* Add this */ 
}