可以肯定的是,只需在相对定位的div(使用背景图像)内使用绝对定位的链接.
示例HTML
<div class="hotspot-container">
<a href="some-href-for-the-hot-spot" class="hotspot"> </a>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.hotspot-container {
width: 200px; height: 200px;
position: relative;
background: url(some-background-image) no-repeat;
}
.hotspot-container .hotspot {
width: 10px; height: 10px;
position: absolute;
top: 20px; /* Top coord of hotspot (relative to parent, bottom: 20px is also valid) */
left: 20px; /* Left coord of hotspot (right: 20px is also valid); */
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13504 次 |
| 最近记录: |