单个响应图像上的多个响应图像?

时间:2016-07-22 11:00:12

标签: html css html5 css3

我正在尝试创建一个包含多个地图指针的地图(7)。

我已设法使用以下代码将它们置于正确的位置。

  <div style="position:relative; left: 0; top: 0;">
              <img src="images/JCCareas.png"  class="img-responsive" style="position:relative; left: 0; top: 0;" alt="Map" />
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 375px; top: 455px;" alt="target Solihull" title="Solihull"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 320px; top: 250px;" alt="target Sheldon"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 490px; top: 520px;" alt="target Knowle"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 290px; top: 365px;" alt="target Olton"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 575px; top: 390px;" alt="target Hampton-In-Arden"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 560px; top: 80px;" alt="target Coleshill"/>
              <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 460px; top: 215px;" alt="target Marston Green"/>
   </div>

地图正在响应,但地图标记不是我在css中尝试了几种方法,但我真的很难让这个工作。

CSS我试过:

#under-image {
position: relative;
display: inline;
}
#over-image {
position:absolute;
left:33%;
top:43%;
max-width: 10%;
}

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试top&amp; left

中的position %
.img1{left: 28%;
    position: absolute;
    top: 49%;
}
.img2{left: 32%;
    position: absolute;
    top: 87%;
}