<html>
<head>
<title>HOver</title>
<style>
.1 {
position:fixed;
top:0;
hieght:100;
width:100;
}
.2 {
position:relative;
top:0;
Z-index:9999;
hieght:100;
width:100;
background-color:white;
}
.2:hover {
background-color:black;
color:white;
}
</style>
</head>
<body>
<div class="1">fdigiuguisagcuiagi</div>
<div class="2">cuoisgdcahouio</div>
</body>
</html>
懸停在此代碼中不起作用。如果我刪除Z-index
,懸停正在工作。如何將懸停效果應用於Z-index應用div?
我該如何爲這段代碼應用懸停?
試着改變你的類的字母而不是數字,所以你可以說.one和.two – RasmusGlenvig
數字類別不起作用 – masterpreenz
使用javascript,onmouse輸入,因爲mouseover不會對具有z-index更高層的元素落後或更低的元素起作用。 – bdalina