spacer

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

home / web / dev / frames / summary

Frames Cheat Sheet

Quality, Affordable Dental Plans from DentalPlans.com
Developer News
Jim Zemlin: The New Center of Linux Gravity
Microsoft's Novell Investment Tops $340M
Fedora 10 Takes Shape

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


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Simple Comments Meets OpenID · Primitive Data Types, Arrays, Loops, and Conditions: Part 3 · How to Create an Ajax Autocomplete Text Field: Part 11
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
eBay Finagles Fixed-Price and Final Value Fees, Cuts Paper Payments · SqlCredit, Part 18: Exploring the Performance of SQL 2005’s OUTPUT Clause · Epson Rolls Out Printers for the Smallest SMBs

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

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