![](/img/trans.png)
[英]How to remove underline from the link which has number but keep underline on normal link which has alphabets
[英]How to remove underline from a link and add underline on hover? (images attached)
我想从链接中删除下划线。 另外,当我用鼠标指针 hover 时,我希望出现下划线。 如何才能做到这一点? 请帮忙。
否 hover:
当我 hover Login
链接:
您需要关闭链接的 CSS 属性text-decoration
,然后在悬停时使用:hover
动态伪 class添加text-decoration
。
a {
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
此外,您可能还需要设置:visited:hover
伪 class 的样式,以便下划线出现在用户已经访问过的链接上。 css 中的链接顺序是一个很好的答案,因为 CSS 规则的顺序很重要。
假设您的登录链接具有 id login
...
#login {
text-decoration: none;
}
#login:hover {
text-decoration: underline;
}
在您的样式表中,无论 ID 是什么。
#LoginButton a:active {text-decoration: none;}
#LoginButton a:hover {text-decoration: underline; color: white;}
在登录按钮中调用 CSSClass 并在样式表中定义以下行,
.ClassName a:link {text-decoration:none;}//removes underline
.ClassName a:hover {text-decoration:underline;}// displays underline on mouse over
希望这可以帮助..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.