Think back to Lesson 4, "Linking Text and Documents," when you learned how to create hyperlinks. You'll remember that you can use the <a name="x" > tag to name an anchor, or target, within a document that could be linked to directly, as shown in the following code. <a name="PointA" >Point A</a> You'll remember that you need to use the anchor tag, <a href="url#anchor">, to surround the text that you want to highlight, as shown in the following example: <a href="DOC2.htm#PointA">Click Here to go to Point A</a> All frames also have the name and id attributes assigned to them. You can use that name to specify which frame you want your hyperlink to open in. Let's look at the HTML code for the toc.htm file used in the preceding examples. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Table of Contents</title> <style type="text/css"> </style> </head> <body> <p><a href="homepage.htm" target="main">HOME</a></p> <p><a href="page1.htm" target="main">Page 1</a></p> <p><a href="page2.htm" target="main">Page 2</a></p> <p><a href="page3.htm" target="main">Page 3</a></p> <p><a href="page4.htm" target="main">Page 4</a></p> </body> </html> Now you see a new attribute has been attached to the <a href> tag: target. The target attribute refers to the target frame for the hyperlink. Besides the frame names that you've specified in your frameset document, you can target the following other three names:
Target Frame
Caution
|