如何在地图区域坐标上书写文字

时间:2013-12-28 16:16:54

标签: html area

有没有办法在html中的图像坐标上写文字? <img src="img.png" width="300" height="45" usemap="#map"> <map name="map"> <area shape=""rect" coords='40,20,126,30'>

1 个答案:

答案 0 :(得分:0)

你可以用一点CSS做到这里是一个例子:

<强> HTML:

<div class="img">

      <img src="" alt="" />

      <h4>Text you want to display on the image</h4>

</div>

<强> CSS:

.img { 
   position: relative;//make the pozition of image relative 

}

h4 { 
   position: absolute; //and give absolute position to your text
   top: 200px; //this top and left values can be taken as coordinates of image 
   left: 0; 

}