gpt4 book ai didi

CSS:如何在悬停时不显示

转载 作者:行者123 更新时间:2023-11-28 15:29:36 25 4
gpt4 key购买 nike

我有

.table_header:nth-of-type(5) {display: none;}

但是,当我将鼠标悬停在页面上的 .table_header 上时,会显示“nth-of-type(5)”。我需要做什么才能使它即使在我悬停时也不会。提前致谢。

最佳答案

Demo Fiddle

为什么不用:not?

.table_header:nth-of-type(5):not(:hover) {display: none;}

From MDN

The negation CSS pseudo-class, :not(X), is a functional notation taking a simple selector X as an argument. It matches an element that is not represented by the argument. X must not contain another negation selector, or any pseudo-elements.

The specificity of the :not pseudo-class is the specificity of its argument. The :not pseudo-class does not add to the selector specificity, unlike other pseudo-classes.

关于CSS:如何在悬停时不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22708583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com