删除:悬停在:elemets之后 [英] Remove :hover on :after elemets
问题描述
我试图删除链接的: c>伪选择器之后的
:hover
行为。但我认为这是不可能的。
I'm trying to remove the :hover
behaviour in an :after
pseudoselector for a link. But I think that it's not possible.
http:// jsfiddle .net / 3N9vs /
有人知道是否可能?谢谢。
Someone knows if it is possible? Thanks.
推荐答案
处理这个问题最简单的方法是换一个 span
每个链接中的文字:
The easiest way to handle this is to wrap a span
around the text in each link:
<a href="#"><span>test</span></a>
在:hover
$ c> span text-decoration:underline
:
On :hover
only the span
is given text-decoration: underline
:
a:hover span {text-decoration: underline}
: http://jsfiddle.net/thirtydot/3N9vs/27/
一个类似的旧问题:无法撤消text-子元素的装饰
也相关: CSS文本装饰属性不能被子元素覆盖
A similar older question: Cannot undo text-decoration for child-elements
Also relevant: CSS text-decoration property cannot be overridden by child element
这篇关于删除:悬停在:elemets之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!