Understanding Targets


A target is a hidden HTML tag ”hidden in that it is not visible to the visitor, but is visible to you in Composer (see Figure 23.18) so that you can see where you put it. In Composer, a target in a file is indicated by a target icon, as shown in Figure 23.18).

Figure 23.18. Target icons in a Composer page, as seen in Normal Edit mode.

graphics/23fig18.gif

graphics/lightbulb_icon.gif

The target icons used to indicate a target location are visible in Composer only when you are working in Normal Edit mode. In Preview mode, the targets are invisible, just as they would be to a visitor browsing your page.

A target provides a location in a page that a link can point to; clicking the link takes a visitor to that exact spot rather than just to the top of the page. A single page can have many targets, each one with a unique name so that a link can point to one and only one particular target. The link that points to a target can be in either the same page the target is in or another page.

Why use targets? Several common scenarios involve long Web pages where, without targets, the visitor would have to do lots of scrolling to locate particular information on a page:

  • At the top of a very long Web page (such as a Frequently Asked Questions, or FAQ, file), you can include a list of links, each of which points to a different part of the file. The links enable the visitor to jump easily to any part of the file rather than have to scroll through it to find a particular section.

  • You might want to use targets when links on one page refer to particular parts of another page that happens to be a long one. The links can point to targets in the long page, to take the visitor directly there in one click.

  • In a frames-based page (see Chapter 27, "Dividing a Page into Frames "), links in one frame can bring up particular parts of a file displayed in another frame. Like the other techniques, this one reduces the visitor's need to scroll, making a Web site easier to navigate.



Sams Teach Yourself Internet and Web Basics All in One
Sams Teach Yourself Internet and Web Basics All in One
ISBN: 0672325330
EAN: 2147483647
Year: 2003
Pages: 350
Authors: Ned Snell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net