gpt4 book ai didi

html - 一般 sibling 不能悬停

转载 作者:行者123 更新时间:2023-11-28 01:42:07 25 4
gpt4 key购买 nike

为什么一般 sibling 不能在悬停上工作?我尝试了所有方法,甚至尝试让它使用 jQuery 但 jQuery 中的 CSS 我不知道如何设置过渡持续时间

.filter h5,
.filter span {
color: #808391;
cursor: pointer;
}
.work div.current h5,
.work div.current span {
cursor: auto;
}
.filter h5:hover
.filter span:hover + h5,
.work div.current h5{
color: #fff;
}

/* general sibling here not work */
.filter span:hover,
.filter h5:hover ~ .et,
.work div.current span {
color: #ed4040;
}
<div class="col-6 col-md-3">
<div class="current filter" filter=".brainstorming">
<span class="icon-genius et"></span>
<h5>Brainstorming</h5>
</div>
</div>

最佳答案

您可以尝试将鼠标悬停在父级上,只选择类 .et 进行更改。

.filter h5,
.filter span {
color: #808391;
cursor: pointer;
}
.work div.current h5,
.work div.current span {
cursor: auto;
}
.filter h5:hover
.filter span:hover + h5,
.work div.current h5{
color: #fff;
}

/* general sibling here not work */
.filter:hover > span.et{
color: #ed4040;
transition: all .5s;
}
<div class="col-6 col-md-3">
<div class="current filter" filter=".brainstorming">
<span class="icon-genius et">colorschange</span>
<h5>Brainstorming</h5>
</div>
</div>

关于html - 一般 sibling 不能悬停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50385784/

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