Image map

From Wikipedia, the free encyclopedia
For image maps in Wikipedia, see Extension:ImageMap.
In HTML and XHTML, an image map is a list of coordinates relating to a specific image, created in
order to hyperlink areas of the image to different destinations (as opposed to a normal image link, in
which the entire area of the image links to a single destination). For example, a map of the world
may have each country hyperlinked to further information about that country. The intention of
an image map is to provide an easy way of linking various parts of an image without dividing the
image into separate image files.


 1Server-side

 2Client-side

o 2.1Pure HTML

o 2.2CSS

 3Creation and use

 4References

 5Tutorials and Web links

Server-side image maps were first supported in Mosaic (web browser) version 1.1.[1] Server-side
image maps enable the web browser to send positional information to the server about where the
user clicks within an image. This allows the server to make pixel-by-pixel decisions about what
content to return in response (possible methods are to use image mask layers, database queries, or
configuration files on the server).
The HTML code for this type of server-side image map requires the <img> tag to be inside an
anchor tag <a>...</a> and the <img> must include the ismap attribute.

<a href="/imagemapper"><img src="image.gif" ismap/></a>

When the user clicks inside the image the browser will append the X and Y coordinates (relative to
the upper-left corner of the image) to the anchor URL as a query string and will access the
resulting URL[2] (for example, /imagemapper?3,9 ).
If the browser does not support ismap then the query string must not be added to the
anchor URL and the server should respond appropriately (for example, by returning a text-only
navigation page).

x2. <area> elements.png" alt="Website map" usemap="#mapname" /> <map name="mapname"> <area shape="rect" coords="9.y2. A title attribute may be provided.radius The following example defines a rectangular area (9. it is often important – and in some cases it may even be a legal or contractual requirement – to provide an alt attribute describing the link that screen reader software can read to. polygons ( shape="poly" ) or circles ( shape="circle" ). they are taken to the English Wikipedia's home page. Creation and use[edit] . for example.y1. <img src="image. For web accessibility reasons.  Rectangle: Set four coordinates: x1. each of which defines a single clickable area within the imagemap. Every pair has an X and a Y value (from left/top of an image) and is separated with a comma.372.y2  Polygon: Set as many coordinates as you want (a multiple of two): x1.66.372. and inside that. This CSS technique may be suitable for making an image map work properly on iPhones. blind users. which is embedded with the <img> tag. The image tag must have an attribute usemap. this only supports rectangular clickable areas. which names the imagemap to use for this image (multiple imagemaps may exist on a single page).y1. [. and do not require any special logic to be executed on the server (they are fully client-side).397" href="http://en. These are similar to the <a> tag defining which URL should be opened for an ordinary web link.66. which can fail to rescale pure HTML image maps" alt="Wikipedia" title="Wikipedia" > </map> CSS[edit] A more modern approach is to overlay links on an image using CSS absolute positioning.Client-side[edit] Client-side image maps were introduced in HTML 3. however.yn  Circle: One coordinate-pair and another value with a radius: x1. the actual image.[3] The <area> elements can be rectangles ( shape="rect" ).y1.. A <map> element. which may be rendered as a tooltip if a desktop user hovers their mouse pointer over the area. They also do not require any JavaScript. 2. When a user clicks anywhere inside this area.wikipedia. Shape-Values are coordinate-pairs.x2.2..] xn.397). Pure HTML[edit] A client-side imagemap in HTML consists of two parts: 1.

2. Jump up^ "HTML: The Markup Language (an HTML language reference)". San Francisco: Sybex Inc. Image map example of The Club. Clicking on a person in the picture causes the browser to load the appropriate article. Jump up^ Flanders. but doing so requires web designers to know how to code HTML as well as how to enumerate the coordinates of the areas they wish to place over the image. many applications have been designed to allow web designers to create image maps quickly and easily. Image maps which do not make their clickable areas obvious risk subjecting the user to mystery meat navigation. Examples of these applications are Adobe's Dreamweaver or KImageMapEditor (for KDE). most image maps coded by hand are simple polygons.1". Web Pages That Suck: Learn Good Design by Looking at Bad Design. Jump up^ "IMG extension for Mosaic 1. 3. Penn State University. Even when they do. much as they would create shapes in a vector graphics editor. ISBN 978-0-7821-2187-2. Vincent (March 1998). and the imagemap plugin found in GIMP. where they lead may not be obvious.[4] References[edit] 1. It is possible to create client-side image maps by hand using a text editor. 4. AccessAbility. This can be partially remedied with rollover effects. Because creating image maps in a text editor requires much time and effort. Jump up^ "Image Maps in HTML". As a result. Tutorials and Web links[edit]  CSS Image Map Techniques and Tutorials Tutorial Design Reviver Categories:  HTML  XHTML . Retrieved 6 October 2013.