Main Page/Previous Lesson/ Learning Paintbrush/ Learning Irfanview

Frames

Frames used to be one of the most popular parts of HTML; however, too many people misused them, and they soon became hated. Frames tutorials are useful but just remember - use them well or not at all!!

The basic layout to frames is simple. You have:

  1. A page that controls the frames
  2. A page for each frame.

Only the "control page" actually tells the frames how to act, so this is the only page we will be talking about for the most part.

Frames come in two different styles, column (cols) and rows (rows). You can combine any number of column and rows that you wish to achieve a deserted effect.

  • The opening and closing y> tags that usually appear in HTML documents have been replaced with tags. These tags identify it as frameset document.
  • The tag does not have an end tag.

    The basic layout:

    <html>
    <head>
    <title>Frames</title>
    </head>
    <frameset cols="*,*">
    <frame src="left.html">
    <frame src="right.html">
    <noframes>
    content for people with old, no frame browser can go here.
    </noframes>
    </html>

    This creates 2 very simple columns (to make rows, just change cols to rows).

    Left.html Right.html

    We will now add some variables to the frames in order to make them look and function better.

    variables:

    <frameset .... >

    • cols="x,y" the creates column for the frames
    • rows="x,y" this creates rows for the frames
    • framespacing="0" this spaces the frames from each other
    • frameborder="0" this create or does not create a border for the frames
    • border="0" this also creates or does not create a border for the frames
    <frame .... >
    • marginwidth="0" this sets the margin width for the frames (any number works)
    • marginheight="0" this sets the margin height for the frames (any number works)
    • name="name-here" this works for targeting (talked about later)
    • scrolling="no" this tells the browser to allow scrolling or not (yes/no/auto)
    • noresize this tells the browser not to allow a frame to be re sizeable by the user (optional)
    </frame>

    </frameset>
    • Note how we close <frameset> tag last. Remember to close it or netscape won't see your frames!


    As you read before, one of the variables for the <frame> tag is name="name-here". This is part of targeting. A function that allows the webmaster to direct where a page should load (which frame). To use targeting, give each frame a name. Once you have done this, you are ready to target. The trick to targeting is simply entering the correct name in the link. For instance, if you had a page with a right frame (name="right") and a left frame (name="left"). And you wanted to have a link from the left frame open in the right frame, you would add target="right" to the link. So now, the link looks like <a href="url" target="right"> click me </a>. Of course, you can do much more complex targeting if you want, and using our 2 frame targeter script (under the java script tutorial), you can have a link open in multiple frames at once. However, before we end this tutorial we have one thing left to cover, targeting part 2. Besides targeting from one frame to another, you can target to a new page and more. Below are some common targets.

    • target="_new" open the page in a new window, but only once
    • target="_blank" opens the page in a new window, every time
    • target="_top" opens the page in the same window, but erases all current frames





  • Main Page/Previous Lesson /Learning Paintbrush/ Learning Irfanview





























    Hosted by www.Geocities.ws