Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<frame>

<frame
align=left|center|right|top|bottom
bordercolor=colour
class=type
frameborder=1|0
framespacing=n
id=value
longdesc=url
marginheight=height
marginwidth=width
name=name
noresize
scrolling=yes|no
src=address
title=text
</frame>

Defines a single frame in a frameset. The tag appears with the <frameset> tag.

The frameborder and framespacing attributes are inherited from the <frameset> tag, which means you need only set the attribute on the single, outermost <frameset> tag to affect all <frame> tags on that page.

There is no end-tag.

Attributes

align=left|center|right|top|bottom

Sets the alignment of the frame or of the surrounding text. The default is left.

Value…

Description…

left

The frame is drawn as a left-flush "floating frame," and text flows around it

center

Surrounding text is aligned with the centre of the frame

right

The frame is drawn as a right-flush "floating frame," and text flows around it

top

Surrounding text is aligned with the top of the frame

bottom

Surrounding text is aligned with the bottom of the frame

bordercolor=colour

The colour of the border of the specified frame. It can also be used in the <frameset> element to globally set the border colours of a whole frameset. It accepts any #rrggbb hex triplet as a value. Setting the bordercolor attribute in the <frame> element over-rides any setting given in the <frameset> element.

class=type

Indicates the class to which the tag belongs. You can use the class attribute in a style sheet to create different styles that you want apply to a single HTML tag. For example, you might create three different styles for a <frame> tag. See Using the class attribute as a selector for more details.

frameborder=1|0

Draws a 3-D border around the frame. Set to 1 (default) to insert a border. Set to zero (0) if you don’t want to display a border.

framespacing=n

Sets extra space around frames to give the appearance of floating frames. The number should be the distance required around the frame in pixels.

id=value

Specifies a unique name for the tag. No two tags can have the same id on a single page. The value must begin with a letter followed by any alphanumeric character, a hyphen, an underscore, a colon or a full stop. You use it to reference a unique style sheet identifier or to manipulate the tag with a script.

longdesc=url

Specifies a link to a long description of the frame. This description should supplement the short description provided using the title attribute and may be particularly useful for non-visual user agents.

marginheight=height

Controls the margin height for the frame, in pixels.

marginwidth=width

Controls the margin width for the frame, in pixels.

name=name

Provides a target name for the frame.

You use the name attribute to assign a name to a frame so that you can target it with links in other pages by using <a href="URL" target="frame_name">. This would usually be from other pages in the same frame set. The name attribute is optional; by default all windows are unnamed.

Names must begin with an alphanumeric character. Several reserved names have been defined, which start with an underscore. These are currently:

Value…

Description…

name

Loads the link into the window or frame with this name. The name must begin with an alphanumeric character

_blank

Load page into a new blank window

_parent

Load the page into the immediate parent of the page

_self

Load the page into the current window

_top

Load the page into the full body of the window

noresize

Prevents the user from resizing the frame. By default, a user can resize the frame by dragging the frame edge to a new position.

scrolling=yes|no|auto

Creates a scrolling frame. If you set this attribute to yes, the frame has a scroll bar. If you set the attribute to auto, the browser decides whether to display scroll bars.

src=address

Displays the source file for the frame.

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).