HTML 代码
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="center-box">
<ul>
<li id="fim"><img src="images/1.png" /></li>
<li id="sim"><img src="images/2.png" /></li>
<li id="tim"><img src="images/3.png" /></li>
<li id="fom"><img src="images/4.png" /></li>
</ul>
</div>
</body>
</html>
CSS 代码
html {
height:100%;
}
body {
background:black;
border:1px solid white;
margin:0;
padding:0;
position:absolute;
height:100%;
width:100%;
}
#center-box {
border:4px solid white;
color:white;
position:absolute;
width:250px;
height:250px;
left:50%;
top:50%;
margin-left:-150px;
margin-top:-150px;
background:grey;
}
#center-box ul {
list-style-type:none;
margin:5px;
padding:18px;
}
#center-box ul li {
display:inline;
}
#center-box ul li:hover {
background-color:blue;
}
它在页面中间只有一个框,以及一个包含透明 (PNG) 图像的内联列表。我想通过悬停在透明图像上来更改其背景颜色,但它充当图像不透明。你会建议如何解决这个问题?