为什么点击链接后链接下划线出现? [英] Why is link underline appearing after clicking the link?

查看:160
本文介绍了为什么点击链接后链接下划线出现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个定位标记样式为
text-decoration:none

$



从我的链接中删除下划线,这是我想要的。



但是在链接被点击之后,链接下划线的小部分出现在



我有这样的东西

 < a ng -click =toggle(this)style =text-decoration:none> 
< i class =fa fa-caret-downng-if =!collapsed>< / i>
< i class =fa fa-folder-open-ong-if =!collapsed>< / i>
< i class =fa fa-caret-rightng-if =collapsed>< / i>
< i class =fa fa-folder-ong-if =collapsed>< / i>
< / a>

(使用字体真棒图标)





有没有什么办法摆脱这个链接下划线一次,总是?

解决方案

这是因为链接的默认CSS值是由不同的浏览器声明的。




  • 正常

  • 悬停

  • 活动(在mouseclick上)

  • 访问过

  • (焦点)



在CSS中,你可以声明每一个的样式。如果您希望链接在以下状态下不显示文本装饰:

  a,a:hover,a: a:visited {
text-decoration:none;
}

回覆您的意见 b
$ b

是的,您可以将a替换为类名。例如,您有一个类'myLink'的链接。



您可以创建CSS:

  .myLink,.myLink:hover,.myLink:active,.myLink:visited {
text-decoration:none;
}


I have an anchor tag styled with text-decoration: none.

This has removed the underline from my links, which is what I want.

However after the link is clicked, little bits of the link underline appear under the spaces between the icons in the link.

I have something like this

<a ng-click="toggle(this)" style="text-decoration: none">
  <i class="fa fa-caret-down"  ng-if="!collapsed"></i>
  <i class="fa fa-folder-open-o" ng-if="!collapsed"></i>
  <i class="fa fa-caret-right"  ng-if="collapsed"></i>
  <i class="fa fa-folder-o" ng-if="collapsed"></i>
</a>

(Using font awesome icons)

The underline is appearing just under the blank space between the icons.

Is there any way to get rid of that link underline for once and for always?!

解决方案

That is because the default CSS values for links are declared by different browsers. A link has 4 official states.

  • Normal
  • Hover
  • Active (On mouseclick)
  • Visited
  • (Focus)

In CSS you can declare the style for each of these. If you want the link not to display the text-decoration in these states:

a, a:hover, a:active, a:visited {
    text-decoration:none;
}

Answer to your comment

Yes, you can replace the a with a classname. For instance, you have a link with the class 'myLink'.

You can make the CSS:

.myLink, .myLink:hover, .myLink:active, .myLink:visited {
    text-decoration:none;
}

这篇关于为什么点击链接后链接下划线出现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆