我已经编写了一些代码,因此当您滚动图像时会弹出一个描述框,但是它的 CSS 设置方式我必须在悬停类中包含弹出框,这意味着当您从基础图像移到它留下的框,我该如何更改它,以便在将光标从图标图像移动后框消失。
<!DOCTYPE html>
<html>
<head>
<style>
p { margin-top: -6px; }
h1.d1 {
color: #0195d3;
font-size: 18px;
font-weight:bold;
font-family:"Veranda",Arial;
letter-spacing:.8px;
text-align:left;
}
p.d2 {
color:#c8c8c8;
font-size: 12px;
font-family:"Veranda",Arial;
letter-spacing:.05px;
line-height:100%;
text-align:left;
}
.desc{
background: black;
opacity: .85;
height: 140px;
width: 180px;
margin: 0 auto;
position: absolute;
text-align: center;
top: -100px;
left:-20px;
display:none;
padding:1px 20px;
}
.desc:after{
content:'';
position:absolute;
bottom:-5px;
width:20px;
height:20px;
background:black;
left:20%;
margin-left:-10px;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
transform:rotate(45deg);
}
.icon {
margin:200px;
float:left;
position:relative;
cursor:pointer;
}
.icon:hover .desc{
display:block;
}
</style>
</head>
<body>
<div class="icon">
<img src="Images/Icon/Vault.png">
<div class="desc">
<h1 class="d1">Vault</h1>
<p class="d2">9/24/13</p>
<p class="d2">Who knew a 2D platformer could also be an epic RPG quest?
Vault is about exploration and...</p>
</div>
</div>
</body>
</html>