2

I have a homescreen image that I need to have different sites linked to, but am still not able to make my area map work. I've tried reordering the and and double checking spelling. I have also double checked the coordinates. Thoughts?

<p><map name="epacbanner"> 
<area shape="rect" coords="0,336,156,489" href="https://www.google.com" 
alt="contact" />
</map> <img src="/content/epac%20banner_final.png" alt="epac banner" 
title="epac banner" width="960" height="322" img="" usemap="#epacbanner" />
</p>
becky armstrong
  • 73
  • 2
  • 3
  • 9

1 Answers1

3

The problem is not with your HTML but the coordinate values, as you have specified a rect the first two coordinates are the x,y position of the top left corner of the shape. You have specified 336 for the y value when your image is in fact only 322 pixels tall (height) Changing that value to 0 places a rectangle at the top left of the sample image as shown in the second example below.

<p>
<img src="http://lorempixel.com/960/322" alt="epac banner" 
  title="epac banner" width="960" height="322" usemap="#epacbanner" />
  <map name="epacbanner">
    <area shape="rect" coords="0,336,156,489" href="https://www.google.com" 
  alt="contact" />
  </map>
  
</p>

<p>
<img src="http://lorempixel.com/960/322" alt="epac banner" 
  title="epac banner" width="960" height="322" usemap="#epacbanner" />
  <map name="epacbanner">
    <area shape="rect" coords="0,0,156,489" href="https://www.google.com" 
  alt="contact" />
  </map>
  
</p>
pokeybit
  • 1,032
  • 11
  • 18