1
我在这里有一些代码试图显示一张图片,然后当鼠标悬停在显示标题的某些部分。css中的图像地图标题?
我使用文本,但不是图片。我几乎没有使用CSS,但更熟悉HTML。 这里有什么问题,我怎样才能使它工作?理想情况下,它应该像“剑”一样工作。
<html>
<body background="Gray.jpeg">
<style type="text/css">
ul, li {
list-style: none;
}
ul.bindel {
position: relative;
float: center;
width: 514px;
height: 528px;
/* background: url(Gladiators.jpeg) no-repeat; */
background: url(http://4.bp.blogspot.com/_XJDCOO_PcIc/TRknvnbiNNI/AAAAAAAAEDg/6KPijl4Dtl0/s1600/Gladiators.jpg) no-repeat;
border: 1px solid #000000;
}
ul.bindel li a span.caption {
display: none;
position: absolute;
top: 20px;
left: 50px;
width: 270px;
padding: 5px;
}
ul.bindel li a:hover {
display: inline;
cursor: pointer;
}
ul.bindel li a:hover span.caption {
display: block;
border: 3px solid #333333;
color: white;
font-size: 17px;
background: #330000;
text-align: left;
}
a.bl {
width: 257px;
height: 264px;
margin-top: 0px;
margin-left: 0px;
}
a.bl:hover {
border: 3px solid #000000;
}
a.br {
width: 257px;
height: 264px;
margin-top: 0px;
margin-left: 258px;
}
a.br:hover {
border: 3px solid #000000;
}
a.bind {
position: relative;
}
a.bind span {
display: none;
position: absolute;
top: 20px;
left: 50px;
width: 270px;
padding: 5px;
}
a.bind:hover {
display: inline;
cursor: pointer;
}
a.bind:hover span {
display: block;
border: 3px solid #333333;
color: white;
font-size: 17px;
background: #330000;
text-align: left;
}
</style>
<center><br>
<a class="bind">Sword<span>The gladiators would use this in close combat.</span></a><br><br><br><br>
<ul class="bindel">
<li><a id="bl"><span class="caption">Left Side</span></a></li>
<li><a id="br"><span class="caption">Right side</span></a></li>
</ul>
</center></body>
</html>
谢谢,尤其是对于解释。 – jackcogdill
不客气。 :)在回答这个问题后,我发现Gimp,Photoshop和其他人提供了一些工具来简化图像映射区域的创建。还没有尝试过它们,但是它们可能会缓解确定多边形协调性的任务。 – enhzflep
是啊,我总是可以使用一些在线工具来快速获取合作伙伴 – jackcogdill