当a
标记包含子元素(如i
标记)时,它仍然在悬停时对其应用下划线,我想知道当有人悬停在a
标记上时,如何从i
标记中删除下划线。
我正在使用的CSS:
a{
display:block;
text-decoration:none;
}
a i{
color:#888;
margin-left:5px;
}
a:hover{
text-decoration:underline;
}
a:hover i{
text-decoration:none !important;
}
下面是一个需要解释的小提琴:http://jsfiddle.net/kkz66x2q/
我只希望当您在链接上悬停时,下划线只在i
元素上消失。
发布于 2014-09-10 02:02:37
试着跟随css,
a:hover i{
display: inline-block; <-- this is the trick
text-decoration:none !important;
}
发布于 2014-09-10 02:02:50
发布于 2016-08-18 01:29:49
我也有同样的问题,并使用以下css规则修复了这个问题:
a:-webkit-any-link {text-decoration:none}
希望能帮上忙!
https://stackoverflow.com/questions/25762427
复制相似问题