我这里有一些代码试图显示图片,然后将鼠标悬停在显示标题的某些部分上。
我有它处理文本,但不是图片。我几乎没有使用过 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>