gpt4 book ai didi

CSS语法,如何使用li.class :hover?

转载 作者:行者123 更新时间:2023-11-28 12:57:47 25 4
gpt4 key购买 nike

我想将一个类应用于 li 元素,但是当悬停事件发生时 ^^

没有这个代码的类我没问题:

#leaderboard li:hover {
z-index:1000;
-webkit-transform: scale(3.2);
-moz-transform: scale(3.2);
-ms-transform: scale(3.2);
-o-transform: scale(3.2);
transform: scale(3.2);
}

但是当我那样尝试时,没问题:

#leaderboard li.0:hover {
z-index:1000;
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}

HTML 在这里:

<ul id="leaderboard" name="leaderboard">
<li class="0" style="left: 0px;"><h1 style="display:inline" id="user-234">4900</h1> <img style="height:50px" src="serveurtopmc.jpg"> xxx</li>
<li class="1" style="left: 440px;"><h1 style="display:inline" id="user-836">4090</h1> <img style="height:50px" src="banniere_1000x240.jpg"> xxx</li>
<li class="2" style="left: 770px;"><h1 style="display:inline" id="user-590">3488</h1> <img style="height:50px" src="9.gif"> xxx</li>
<li class="3" style="left: 770px;"><h1 style="display:inline" id="user-1">2556</h1> <img style="height:50px" src="coeur.png"> xxx</li>
<li class="4" style="left: 880px;"><h1 style="display:inline" id="user-546">2542</h1> <img style="height:50px" src="1372878266-photo15.jpg"> xxx</li>
<li class="5" style="left: 440px;"><h1 style="display:inline" id="user-597">2536</h1> <img style="height:50px" src="logo.png"></li></ul>

有人有正确的语法吗? :)

==========

我做到了,刚刚完成测试(它有点长,因为数字是由 jscript 生成的)这很完美 => #leaderboard li.rank0:hover { 谢谢 mcabrams :)

最佳答案

如果类需要保留数字,您可以转义 0 的 Unicode 代码点:fiddle

#leaderboard li.\30:hover {
color: coral;
}

关于CSS语法,如何使用li.class :hover?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22025041/

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