Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

HTML Images Tutorial - HTML USEMAP

Attribute for <IMG ...>
USEMAP

Looking for info on how to make an image map?

See our tutorial How to Make an Image Map
USEMAP indicates that the image is an image map and uses the map definition named by this attribute. The name of the map is set by the NAME attribute of the <MAP ...> tag. Note that USEMAP requires that you precede the name of the map with a hash symbol (#). For example, the following code creates an image map named map1:

<DIV ALIGN=CENTER>

<MAP NAME="map1">
<AREA 
   HREF="contacts.html" ALT="Contacts" TITLE="Contacts" 
   SHAPE=RECT COORDS="6,116,97,184">
<AREA 
   HREF="products.html" ALT="Products" TITLE="Products" 
   SHAPE=CIRCLE COORDS="251,143,47">
<AREA 
   HREF="new.html" ALT="New!" TITLE="New!"     
   SHAPE=POLY COORDS="150,217, 190,257, 150,297,110,257">
</MAP>

<IMG SRC="testmap.gif" 
   ALT="map of GH site" BORDER=0 WIDTH=300 HEIGHT=300
   USEMAP="#map1"><BR>

[ <A HREF="contacts.html" ALT="Contacts">Contacts</A> ]
[ <A HREF="products.html" ALT="Products">Products</A> ]
[ <A HREF="new.html"      ALT="New!">New!</A> ]
</DIV>

which gives us this map:

Contacts Products New! map of GH site
[ Contacts ] [ Products ] [ New! ]
Theoretically you can reference a map definition that is in an external file, but several browsers have problems with that contruct so it's best to stick to putting maps and map definitions in the same page.

 
 
  Copyright 1997-2002 Idocs inc. Published under the terms of the Open Content License Design by Interspire