Framing the Web / Frames Cheat Sheet | WebReference

Framing the Web / Frames Cheat Sheet

Frames Cheat Sheet

Framing the Web

Conventions:


Basic Tags

The Basic FRAME Tag <frame src="file.html" [name="framename"] [scrolling="yes | no | auto"] [noresize] [marginwidth="pixel measurement"] [marginheight="pixel measurement"] >

The Basic FRAMESET Tag <frameset cols="measurement list" [border="yes | no | pixels (recommended)"] [bordercolor="HEX TRIPLET OR COLOR NAME"] [framespacing="yes | no | pixels (recommended)"] [frameborder="yes | no | pixels (recommended)"]>

measurement list is a comma-delimited list of absolute, relative, or percentage measurements, one for each frame in the frameset.

Examples:
  • absolute: <frameset rows="50,120,600">...</frameset>
  • relative: <frameset cols="2*,*">...</frameset>
  • percentage: <frameset cols="20%,60%,20%">...</frameset>
  • absolute and relative: <frameset rows="80,*">...</frameset>
  • borderless frames: <frameset framespacing="0" frameborder="0" border="0" cols="155,*">
  • border with color: <frameset frameborder="3" bordercolor="#ededed" border="3" cols="155,*">

The NOFRAMES Tag <noframes>...</noframes>

Place HTML code on your frameset document between NOFRAMES tags for people using frames-incapable browsers.


Sample Framesets

A Simple Frameset
<frameset rows="30%,70%">
	<frame src="green.html">
	<frame src="purple.html">
</frameset>
A Complex (Nested) Frameset
<frameset cols="*,2*">
	<frame src="orange.html">
	<frameset rows="30%,70%">
		<frame src="green.html">
		<frame src="purple.html">
	</frameset>
</frameset>


Specifying Targets

The TARGET Attribute <a href="URL" target="windowname">

This is the standard anchortag with the addition of the target attribute.

  • windowname is the name of the target window, as specified in the frame tag. An unrecognized windowname will cause another browser to spawn.

"Magic" TARGETS

There are four kinds of magic targets, all of which begin with an underscore (_):

  • target="_blank" will cause the URL to load into a new unnamed browser.
  • target="_top" will target the URL to the entire browser window.
  • target="_self" will load the URL into the same window.
  • target="_parent" will load the URL into the frameset's parent window.

Comments are welcome

Copyright © 1996 Dan Brown and
Created: May 14, 1996
Revised: Apr. 16, 1998

URL: https://webreference.com/dev/frames/summary.html