<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