<分区>
我想在将中心元素悬停在 this sample 上时隐藏底部和顶部元素:
<div id="tc">
<span id="ct">top</span>
<div id="pc">
<span id="st"></span>
<span id="tp">center</span>
</div>
<span id="tt">bottom</span>
</div>
我可以用 :
隐藏底部元素#pc:hover ~ #tt { display: none!important; }
我希望通过
对顶部元素完成相同的操作:#ct + #pc:hover { display: none!important; }
但它不起作用,甚至破坏了我的第一条指令。
我做错了什么?