Tutorial 14: You've been Framed, Part I - HTML with Style | 6
After a document is loaded into a frame, any subsequent documents loaded by following links in that document are displayed in the same frame. This can be nice since you can have a fixed "decor" around your main page that supplies standard services. However, in order for this to be truly useful, you need to be able to display the tail of a hyperlink from one frame in another frame. This makes it possible, for instance, to have a fixed table of contents in one frame, with links to sections of a multi-page text, and displaying the relevant section every time such a link is clicked on by the user.
- TARGET (Frame target)
- Specifies the name of the frame in which the link's tail will be displayed. Alternatively, can be used to specify the name of a browser window in which to display the document, or may be one of the special frame targets (see text)
When TARGET is set for an A, LINK, or AREA element that specifies a hyperlink, the destination of this link is loaded in the frame named in the value of the attribute. You can also set this attribute on a FORM element so that the ACTION URL is loaded in a different frame. For example, in the framed HTML with Style front page we saw above, the links in the sidebar that lead to the Tools, Tutorials, Style Watch and About pages are loaded in the central frame. Recall our frameset document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd"> <HTML> <HEAD> <TITLE>HTML with Style</TITLE> </HEAD> <FRAMESET ROWS="170,*,17%"> <FRAME NAME="ad" SRC="example2.html" NORESIZE SCROLLING="no"> <FRAMESET COLS="250,*"> <FRAME NAME="sidebar" SRC="example3.html"> <FRAME NAME="main" SRC="example4.html"> </FRAMESET> <FRAME NAME="footer" SRC="example5.html" NORESIZE SCROLLING="no"> </FRAMESET> </HTML>
You can also set the default frame target for a document by setting the TARGET attribute on the BASE element. The value of this attribute will be the default target for all links in the document instead of the current frame. You can override this value by setting the TARGET attribute for individual links.
Produced by Stephanos Piperoglou
Created: June 30, 1999
Revised: June 30, 1999