Free Webmasters Resource
 

Free Graphics, Tutorials, Scripts, Webmaster Forums, Web Templates, SEO Tools, & Much More!!

Home Scripts Tutorials Free Downloads Articles SEO Play Free Games Web Templates

Imagemaps

Imagemaps allow you to add clickable regions to an image using only HTML. They are sometimes less efficient than slicing up an image into a group of smaller images, especially if you plan to use Javascript roll-overs in conjuction with them. However, for irregular shaped objects and creative designs, imagemaps are still very useful. The following method demonstrates how to create client-side imagemaps. (Note: There is also an older variety of imagemaps called server-side imagemaps, but they are less efficient and no longer sensible to use). In the body area of your HTML, create a <map> tag and name it like so:

<map name="testmap">

Next, you need to create <area> tags for each clickable area you wish to put on your image. Each area tag as the following three attributes:

  • shape - defines the shape of the clickable area. The choices are "rect" (rectangular), "circle" (circular), and "poly" (polygonal). The default attribute is "rect," so it is unnecessary to define a shape if you are making a rectangular area.



  • coords - defines the pixel coordinates of the area. These can be found using most any image editing program. (If you are using Photoshop, they can found in the Info Palette.) For rectangles, give the x,y coordinates of the top-left corner followed by that of the bottom-right corner (see example below). For circles, give the x,y coordinates of the center followed by the radius in pixels. For polygons, list the x,y coordinates of all the verticies of the polygon in connect-the-dots order.



  • href - defines the page the area will link to when clicked. It works just like a standard <a href> tag.

The <area> tags do not need closing tags, but the <map> tag does, so make sure to add a </map> after you finish creating your clickable areas. Here is an example of a full imagemap code:

<map name="testmap">
<area coords="22,22,113,51" href="link1.htm">
<area shape="circle" coords="38,67,13" href="link2.htm">
<area shape="poly" coords="145,9, 156,37, 182,37, 175,9" href="link3.htm">
</map>

The final step is to tell an image to use your imagemap. Do this by inserting a "usemap" attribute to an image's <img> tag. Make sure to use a quot;#quot; symbol:

<img src="spoonodelicimage.gif" usemap="#testmap" border=0>

The following is the imagemap created by using the example code:

 

 

Tutorials: HTML

Title/Description

Level

Backgrounds: Tutorial
Learn how to effectively add backgrounds to your page that make your page look professional or amateur.

Beginner

Imagemaps: Tutorial
Make one image into various clickable regions using only HTML

Intermediate

Embedding Fonts: Tutorial
Learn how to use uncommon fonts in web pages by embedding them.

Advanced

Images: Tutorial
Positioning images can make your images look just right when inserted into text.

Intermediate

Form Effects: Tutorial
Learn how to create trendy forms with simple style commands as well as with CSS classes.

Intermediate

Layers: Tutorial
Layers can make complicated image placement possible.

Advanced

Forms: Tutorial
Use forms to gather information from your users.

Advanced

Links: Tutorial
Making links in HTML is the easiest thing you will ever do.

Beginner

Frames: Tutorial
Learn how to create frames that enable you to create navigation systems on your site.

Advanced

Scrollbars: Tutorial
Learn how to add effects to your scrollbars and add flavor to your page.

Advanced

Hide From Print: Tutorial
Learn how to only allow a visitor to print part of your page using CSS.

Intermediate

SSI: Tutorial
Learning how to do SSI will save you a lot of authoring time.

Advanced

Horizontal Line: Tutorial
The horizontal line serves as a great separator tool.

Beginner

Table Styles: Tutorial
Learn how to add various table styles such as dash or dot borders, and many other things.

Intermediate

Iframes: Tutorial
Iframes can organize your website into clean sections.

Advanced

Tables: Tutorial
Organize your web page layouts with tables.

Intermediate

216 Web Safe Color Chart: Tutorial
The 216-color color-safe palette refers to colors (RGB values) that will appear the same on either IE or Netscape and Windows or Mac platforms.

Beginner

Pantone RGB/Hex/HTML Colors: Tutorial
This table contains all pantone colors converted to RGB and Hex. It displays them all in HTML colors.

Intermediate

 


Home Contact Credits Flash Templates Webmaster Forums Site Map Webmaster Resources Advertise


Computer Playground
· Templates Resource