3.4.2 Links and Frames

Now we will put some content in our frames. For this, you first must generate the documents that are to be displayed. Assuming that the mainframe is for the running stuff that you already have, you need a document for the headframe and the sideframe
Start a new page and write something suitable for the headframe on it, e.g. "Homepage of Daniel Düsentrieb". Store that page in the same file as the frameset under any file name you like.
If the side frame is going to contain the index list of the contents of your HTML project, it will probably contain some buttons, i.e. some graphics; but for starters just make a simple page with e.g. "Link 1" and "Link 2" on it. Store it as indicated above.
Now link these pages to the proper frames.
Click on F6 in the frame (displayed in the frame view mode), and make the links to the documents you just generated. They will appear in the frames - look at it with your browser.
Whatever you like to do to the appearance, you do in the documents you loaded, e.g. adding a background color. If you selected a large document, or if you chose a small frame, the frame may now be too small to show all - a scroll bar will have appeared if you enabled that.
Now lets activate the links in the sideframe. Just make a link from the "Link 1" string to any page you like.
Use the browser and activate the link. Surprise! The document appears in your little sideframe! Your intention certainly was to have it in the mainframe - but how is the browser supposed to know that?
Obviously, the links now must carry an attribute that decides into which frame the document shall be loaded. This is the attribute "TARGET" if you go to the attribute list of a link. Unfortunately, there is no menu that specifies the possible target attributes because there are two kinds that you can use:
1. The names of your own frames which, after all, only you know. Try it. Use the link from before but now write "mainframe" in the target attribute space (if you called your big frame "mainframe"). The document will now appear where it should - in your main frame.
2. Some general commands. Lets find out why these are needed by making a link from your mainframe to some outside index page - anybody else´s index page from the groups. What you get is their frame set within your mainframe frame - you have frames within frames! No write "_top" in the target attribute and try again - you will now have only the index page with the frames of the other group, your frame set is gone. What you loaded is now on top of whatever was there before.
Other possible entries are:
  • _self: The document will be opened in the frame containing the link
  • _blank: The document will be opened in a new window (your browser will be there twice now!)
  • _parent: the parent frame set of the current frame will become a single frame, and the document will be displayed there (what ever that means).


index.gif zurueck.gif