HTML <frame> tag

The <frame> tag is used to create a frame in a frameset.

NOTE: The <frame> tag and the other frame tags (<frameset>, <noframes>) should only be used with a Frameset document type.

NOTE: The <frame> tag does not have a closing tag

Attributes

Attribute Description Possible values
frameborder Sets whether or not a frame has a border 0, 1
longdesc URL to a page that describes the contents of the frame theURL
marginheight Sets a frame's top and bottom margins numericValue
marginwidth Sets a frame's left and right margins numericValue
name Sets a frame's name frameName
noresize Prevents the user from resizing a frame noresize
scrolling Sets whether or not a frame can be scrolled yes, no, auto (default)
src URL of the file that will appear in a frame theURL

Standard attributes

class, id, style, title

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

NONE

For more information on event attributes, check out our HTML event attributes reference page.

Example

<frameset rows="20%, 60%, 20%"> <frame src="menu.html" name="menu" noresize="noresize" /> <frame src="content.html" name="content" noresize="noresize" scrolling="yes" /> <frame src="footer.html" name="nav" noresize="noresize" marginheight="10" /> </frameset>
Output:

Click here to see the frame in a window by itself

Tips & notes

Not every frame in a frameset has to be the same, each frame in a frameset is unique. Each frame can have its own border (or no border at all), a resizing option, a scrolling option, and more.

When creating a frames page, do not use the <body> tag. However, if you use the <noframes> tag, sorround the content in it with <body></body> tags.

Frames caution

Frames require your visitors to load more than one page at a time. This can create bandwidth issues (more pages to load at a time) and time issues (extra time spent loading pages) that will negatively affect your website and your users experience.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation