spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / dev / frames / summary

Frames Cheat Sheet

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

Framing the Web

Conventions:

  • Tag syntax appears in monospaced font.
  • Optional attributes appear between [ brackets ].
  • Parameter choices are divided by pipes |.
  • Author-specified parameters appear in italics.
  • Items marked with an asterisk (*) are not currently covered in the tutorial.


Basic Tags

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

  • file.html is the name of the HTML file to display in the frame.
  • framename is the name assigned to the frame for use in conjunction with TARGET.
  • scrolling determines whether the frame has scrollbars.

    scrollbars embedded in a frame

  • * noresize is a flag that specifies the user cannot resize the frame.
  • * marginwidth and marginheight determine the frame's margins in pixels.

    Margins
    0 20

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.

  • absolute measurements specify the sizes of the frames in pixels.
  • relative measurements specify the sizes of the frames, relative to the other frames.
  • percentage measurements specify the sizes of the frames as percentages of the whole browser window.
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 anchortarget 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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

Created: May 14, 1996
Revised: Apr. 16, 1998

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