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