A simple analogy that may help understand targeting of a frame, is targeting as in hunting. The hunter must first define his target. The frameset is where names are given to targeted frames. For this example, "bullseye" is the frame name. The link or anchor tag, <a href="ammo.html">bullet</a> is our weapon. We must now aim at the target(frame) if we expect to hit it. Aiming the weapon(link/anchor tag) is accomplished by pointing it at our target(frame). Including instructions in the anchor tag's code will take aim. Adding target="bullseye" within the anchor tag gives aim to the weapon. The link (anchor/weapon) loaded and aimed becomes <a href="ammo.html" target="bullseye">bullet</a>. When a visitor fires the weapon, it hits the frame named "bullseye" and "ammo.html" loads in that frame.
So if not addressed in your code, when the user of your framed pages activates a link, it will load into the same frame. However, in most frame pages you likely wish for the link to load in a different frame or window. First, remember to name any frame to be targeted in the frameset. Second, use that target name within the anchor tag of those links you wish to load in the target frame.
If you modify the <A>, anchor tag then you can specify the frame in which the selected link is to load. The syntax is:
<A href="URL" target="NAME">LINK TEXT</A>
where 'URL' is the address of the page that you wish to load in the target frame. 'Name' is the name of the target frame. 'Link Text' is the clickable text that will appear on screen.
The file, navigation.html, is the 'menu' frame for the site and is the lefthand column of this frameset example. It includes links to other parts of the site, which , when selected, open in the site's righthand column, the frame named 'display'. The source code for navigation.html is shown below:<HTML>
When selected, each of these links will load in the frame named 'display'.<HTML>
There are several reserved targets for frames, with special properties. Target= "_parent" loads the link over the current frameset. Target= "_blank" forces the link to load in a new browser window. Target= "_self" forces the link to load into its own frame. While target= "_top" forces the link to load into the whole window, which is useful for breaking out of a frameset.
Special ConditionIf all of your links in the menu frame are to target the frame named 'display', you can include <base target="display"> within the <head> tag of the menu frame. This precludes having to add target="display" within each link listed in the 'menu' frame. Give this one careful thought to avoid a lot of redo later. :- (
Other Options1. When targeting a web page from a frame within the frameset and you wish for it to load in the 'full' window, include target="_parent" in the anchor for that link. Otherwise, the linked document will load in the frame.
2. If you wish for a targeted web page to open in a 'new' browser window that is layered over your current window, include target="_blank" in the anchor for that link. This is handy if you wish to keep visitors at your site. When they close the layered window they are back on your frame page.