我想要一類適用於li元素,但是當懸停事件^^CSS語法,如何使用li.class:hover?
我沒有這個代碼的類很確定:
#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);
}
但是當我嘗試這樣的,這是NOK OK :
#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>
有人有右擊請問t語法? :)
==========
我做到了,剛做完測試它(這是一個有點長,因爲是由一個JScript生成的號碼)的工作完全=>#排行榜li.rank0:懸停{感謝mcabrams :)
喜Wolwx,你可以發佈你的HTML嗎? –
什麼是'.0'?班級名稱不應以數字開頭。 –
允許類標識符以數字開頭。 ID的另一方面不能。 *編輯:顯然都將實際工作是這樣的:http://stackoverflow.com/questions/9210307/html-5-classnames-and-ids – mcabrams