Lecture 7 - Image Maps and Frames - 2007 - FAII - 07
Lecture 7 - Image Maps and Frames - 2007 - FAII - 07
Outline
In this Lecture, we continue our discussion of XHTML
Adding multiple links to a single image:
Making and using Image Maps
Dividing our page into several frames:
The frameset document
Image Maps
You may divide an image into ‘hotspots’:
Where each hotspot is a clickable region, which can serve as a link.
Such a divided graphics are called imagemaps.
For fun, in this example, I will use only the id attribute in my map.
And omit the name attribute.
As a result, it validates as good XHTML 1.0 Transitional…
However, it works only in IE6, not Netscape.
To make it work in Netscape, Opera, and Mozilla:
You must also add the attribute: name=“fuzzytotoro_map”.
Step 3: Define Your Hotspots
Next, define each clickable area, with the area element:
Each area is nested in the map element, and has the form:
<area alt=“info” shape=“type” coords=“c”
href=“url” target=“name” accesskey=“x” />
Here, attribute alt provides alternative text (as usual);
Attribute shape defines the shape of the hotspot (clickable area);
Circle (shape=“circle”); Rectangle (shape=“rect”); Polygon (shape=“poly”)
Attribute coords provides details of the shape:
For a circle: c= “x,y,r”
Rectangle: c = “x1,y1,x2,y2”, etc
Attribute href defines the destination URL (as usual).
Here, marginwidth :
controls space on frame sides;
Similarly, marginheight :
controls space on frame top and bottom.
For each, values x, y are in pixels.