Click to See Complete Forum and Search --> : <map> tag


pathfinder74
03-06-2009, 03:22 PM
Can you do a map without an image?
Like map a <div>?

TheBearMay
03-06-2009, 04:34 PM
usemap isn't an attribute for <div> so, afraid not....

pathfinder74
03-10-2009, 12:55 PM
is there any way to do use map without using an image or does it only work with <img> tags?

I don't want to put the image into the html in case I decide later to re-skin the page...

TheBearMay
03-10-2009, 01:34 PM
No, can only be used with an <img>.

pathfinder74
03-10-2009, 03:09 PM
Do you have to have a src image?

You can have the whole thing like this:

<img width="145" height="126" usemap="#planetmap" />

<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm" />
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm" />
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm" />
</map>

I'm taking that right from W3 schools but deleting the src and the alt.

Only issue is that there is one of those image placeholder things there. If I could get rid of that to where there is a defined size but not image placeholder icon I could probably accomplish what I want... which is to have an image map laying over a div that has a background image.

Like I said... I'm going this to avoid having to put the image into the HTML...

rpgfan3233
03-10-2009, 03:18 PM
Yes, @src is required. @alt is used for accessibility reasons and should be used when possible.

You could try stretching a 1x1 transparent GIF and attach @usemap to that image I guess...

pathfinder74
03-11-2009, 07:23 AM
I have actually done that before for this very reason. It's a sucky way but better than nothing.

I would just use text but the only problem with that is between IE and FF the alignment is off just enough to throw off the look that I'm trying to accomplish.