Frames using Frameset

Frames allow the designer of web pages to show more than one HTML document on the same screen.

Frames use a number of basic tags

    <frameset> use at the start of the document (replaces the <body> tag)
    <frame> defines which document is shown in a particular frame
    <noframes> for use where browsers do not support frames

One of the simplest designs is illustrated using the script below and would look like this

Copy and paste this script and try it yourself

No borders? No worries! Try this

just add frameborder=no border=0 marginwidth="0" framespacing=0 marginheight="0" to the frameset tag as below

The it would look like this

Linking Frames

Using the normal <a href="url"> you can load a particular document into a particular frame. This uses the TARGET attribute to determine which page is loaded into which frame:

Getting out!

You can always return to a non frame page using the back arrow of the browser, but you can also use the TARGET attribute to do this in your code. In each frame of the example shown above is the clickable link Let me out of these Frames it takes you back to the parent page in this case frames.htm:

Here is an example which shows one of the most common uses of frames: to provide a site with an index that is always on display

  Return to top of page