30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix K Introduction <strong>to</strong> XHTML: Part 2 1447<br />

41 <br />

44<br />

45 <br />

46 <br />

47 <br />

50 <br />

51<br />

52 <br />

53 <br />

54 <br />

56 <br />

57<br />

58 <br />

59 <br />

Fig. K.7 Image with links anchored <strong>to</strong> an image map (part 2 of 2).<br />

Lines 19–50 define an image map via a map element. Attribute id (line 19) identifies<br />

the image map. If id is omitted, the map cannot be referenced by an image. Shortly, we<br />

discuss how <strong>to</strong> reference an image map. Hotspots are defined with area elements (as<br />

shown on lines 24–26). Attribute href (line 24) specifies the link’s target (i.e., the<br />

resource <strong>to</strong> which <strong>to</strong> link). Attributes shape (line 24) and coords (line 25) specify the<br />

hotspot’s shape and coordinates, respectively. Attribute alt (line 26) provides alternative<br />

text for the link.<br />

Common <strong>Program</strong>ming Error K.5<br />

Not specifying an id attribute for a map element prevents an img element from using the<br />

map’s area elements <strong>to</strong> define hotspots. K.5<br />

The markup on lines 24–26 creates a rectangular hotspot (shape = "rect") for the<br />

coordinates specified in the coords attribute. A coordinate pair consists of two numbers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!