如果我有标记:防止伪元素触发悬停?
<div class="a b"></div>
其中.A类与关联的悬停类它
和.B类有与它相关联......像这样一个伪元素:
div
{
width: 100px;
height: 100px;
}
.a { background: red; display: inline-block; }
.a:hover { background: green; }
.b:after
{
content: '';
display: inline-block;
width: 100px;
height: 100px;
margin-left: 100px;
background: pink;
}
是否可以用CSS防止伪元素触发.a类悬停?
你能提供你想要的和你有什么的快照吗? – Nitesh
Afaik这是不可能的,因为伪元素是真实元素的孩子。 – powerbuoy
** not **选择器可以帮助吗? – Danield