|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
ISMAP and USEMAPImagemaps are clickable images that load different pages depending on where you click the image. They are frequently found on the main page of a site, where they typically serve as a navigational tool to the major sections of the site. See Imagemaps, p. 137. The ISMAP attribute of the <IMG> tag is a standalone attribute that tells the browser that the image is to be used as part of a server-side imagemap. The USEMAP attribute of the <IMG> tag is set equal to the name of a client-side imagemap. With client-side imagemaps, map information is named and sent directly to the browser. Setting USEMAP equal to a map name instructs the browser to use the map information associated with that name. LONGDESCThe LONGDESC attribute was added to HTML 4.0 as a way of making image content more accessible to users with nonvisual browsers. You set LONGDESC equal to the URL of a document that can provide a longer description of the images content than you would otherwise put in an ALT attribute. A speech- or Braille-based browser could then access the URL and furnish a description of the image to the user. Images as Hyperlink AnchorsAs explained in Chapter 3, HTML 4.0 Tag Reference, the <A> container tag is used to create hypertext anchors. By clicking the hypertext, you instruct your browser to load the resource at the URL specified in the HREF attribute of the <A> tag. No law says that hyperlink anchors can only be text. You will often find images serving as anchors, as well. By linking images to other Web pages, you create a button-like effectthe user clicks the button and the browser loads a new page, submits a form, or performs some other action. You can even rig a linked image with JavaScript to submit a form: <IMG SRC=... onClick=document.form_name.submit();> To use a graphic as a hyperlink anchor, put the <IMG> tag that places the graphic between <A> and </A> tags: <A HREF=button.html> <IMG SRC=images/button.gif ALT=Push button></A> This results in the linked image shown in Figure 5.7. Notice that the image has a border even though no BORDER attribute was specified. Hyperlinked images automatically receive a border colored with the same colors that you set up for hypertext links using the LINK, VLINK, and ALINK attributes of the <BODY> tag.
Images as Bullet CharactersSome people opt to create their own bullet characters for bulleted lists instead of using the characters that browsers provide. To do this, you need to place the bullet graphic with an <IMG> tag and follow it with a list item: <IMG SRC=bullet.gif WIDTH=12 HEIGHT=12 ALT=*>HTML 4.0<BR> <IMG SRC=bullet.gif WIDTH=12 HEIGHT=12 ALT=*>XML 1.0<BR> <IMG SRC=bullet.gif WIDTH=12 HEIGHT=12 ALT=*>Java 1.2<BR> <IMG SRC=bullet.gif WIDTH=12 HEIGHT=12 ALT=*>JavaScript 1.3<BR>
Several things should be noted about this HTML:
Usually, this is enough to deter many page authors from using their own bullet characters. If you are still determined to use custom bullets, however, you need to be aware of one more alignment issue: If a list item is long enough to break to a new line, the next line starts below the bullet graphic; it is not indented from it (see Figure 5.9). This detracts from the nicely indented presentation that users expect from a bulleted list. One way to avoid this problem is to make list items short enough to fit on one line. If that isnt possible, you should consider setting up your list with custom bullets in an HTML table. By placing the bullet image in its own cell and the list item text in the adjacent cell in the same table row, you can control both alignment and line breaking. See Tables, p. 183. Images as Horizontal RulesSome sites also use a custom graphic in place of a horizontal rule (see Figure 5.10). This is a nice way to subtly reinforce a sites graphic theme.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |