[main] [misc] [graphics] [page design] [site design] [xhtml] [css] [xml] [xsl] [schema] [javascript] [php] [mysql]

HVCC Home
Blackboard HVCC
Blackboard Manual
Faculty Association

xhtml main
1. what is xhtml
2. xhtml document basics
3. xhtml basics
4. xhtml special chars
5. xhtml attributes
6. xhtml hyperlinks
7. xhtml images
8. xhtml tables
9. xhtml forms
10. xhtml frames
a. xhtml frame basics
b. xhtml frameset tag
* c. xhtml frame tag
d. xhtml frame nesting
e. xhtml frame targeting
f. xhtml noframes tag
g. xhtml inline frames
11. xhtml meta content


print version

Note that all external links will open up in a separate window.

This is a stripped down version of these pages for older browsers. These pages are really meant to be viewed in a standards compliant browser.

Directions for surfing with audio.

The Frame Tag

These tutorials are about XHTML, the Extensible Hypertext Markup Language.

The <frame /> tag

The <frame /> tag is used to specify the contents of each frame in a frame set. It is also used to specify formatting information for that particular frame. It's primary attribute is the src attribute, which is used to specify a document to be included in that frame.

The following code segment defines the frame set with two frames.

<frameset cols="100, *">
  <frame src="document1.html" />
  <frame src="document2.html" />
</frameset>  

In the above instance, the window would have two frames next to each other in columns. The first one would be 100 pixels wide and would contain document1.html. The second one would fill the rest of the screen and contain document2.html.

The other attributes, with descriptions of their functions, are as follows:

name and id

The name and id attributes are used to uniquely name an element so that it can be addressed. name is the old standard, while id is the new standard. You can always use both for backward compatability.

These attributes serve to name the frame so that you can address it using the target attribute of hyperlink tags. Once you have named a frame you can target a document to open in that frame. On of the benefits of frames is being able to do things like have two documents in the window at the same time, one of which is a menu and the other of which is content that is selected from that menu. It is a good habit to name all your frames.

See below for more details on targeting frames

scrolling

This attribute takes one of three values:

  • auto - the default value. This causes scroll bars to be inserted if the contents of the frame are larger than the frame.
  • no - this turns off scrolling. If the document is larger than the frame, then the missing bits cannot be seen since there is no way to scroll to them. Although frames look nicer without too many scroll bars, turning them off should only be done when you are sure the contents will fit in the frame.
  • yes - this turns on scrolling. Even if the document does fit in the frame, there will be scroll bars present. This is usually done to avoid scroll bars appearing and disappearing while moving between different sized documents.
frameborder

This attribute takes a number that specifies how many pixels wide to make the border between this frame and any adjacent frames. If the value is zero (0), then there will be no border. If adjacent frames have different borders specified, the thicker of the two borders is the one displayed between them.

noresize

This attribute traditionally was a switch, which meant it did not take a value, if coding XHTML, you need to write noresize="noresize". This attribute prevents this frame from being resized. Like a window, a frame can be resized by clicking and dragging the border of the frame. If a frame cannot be resized than frames adjacent to it cannot be resized if doing so would affect the size of the noresize frame.

This attribute is often a good idea unless you want people to be able to resize your frames. A good example of resizable frames in use is a frameset that has a directions frame and an activity frame. By being able to resize the directions frame, the user can "drag it out of the way" in order to have more space freed up for the activity frame. They can then "drag it back into place" when then need to refer to the instructions.

marginheight and marginwidth

The attributes allow you to specify how thick to make the margins between the current frame and adjacent frames. They take a number which represents the thickness in pixels.

longdesc

This attribute is supposed to take a URL as it value that contains a description of the frame contents or alternative content for non-visual media. It is not yet supported on any browsers.

[top]