Note: If you don't know what an element/tag is and/or how you must use it we recommend you read our HTML tags and attributes tutorial, which you can find in our HTML tutorials section.
Table of contents
Bypass table of contentsThe HTML frame element inserts a frame in a frame set (HTML frameset element). A frame set is used to divide the space of the document where it is inserted, and load a different document in each space.
The distribution of these spaces is set by the HTML frameset element, and each space is defined by the HTML frame element. Every frame must specify which document will be loaded inside of it.
In XHTML 1.0 the "name" attribute for this element has been deprecated in favor of the "id" attribute. Its use is no longer recommended.
In the following example, the space is divided vertically in two identical frames, and a document is loaded in each of them. This example is useful for documents comparison.
The "id" attribute assigns an identifier to the associated element. This identifier must be unique in the document and can be used to refer to that element in other instances (e.g., from client-side scripts).
The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element. It is used together with style sheets and tells the browser the class (or classes) to which the element is associated.
A class gives presentational attributes to elements (read more at the Cascading Style Sheets tutorial).
This attribute is used to define presentational attributes for the containing element, and its value should be composed by style sheets properties. Although in some cases it can become useful, a better practice is to place presentational attributes in external files, relating them to elements with the "class" attribute. This way you keep the semantic and presentational parts of your document separated.
You can find more information about presentational attributes at the Cascading Style Sheets tutorial.
The purpose of this attribute is to provide a title for the element. Its value must be a short and accurate description of the element. Browsers usually render it as a "tool tip" when the user puts the mouse pointer over the element for a short period of time.
This attribute points to the document that will be initially loaded in the frame (when the frameset is loaded).
Points to a resource with an extended description for the frame purpose. It is supposed to supplement the information provided in the "title" attribute.
When present, this attribute indicates that the size of the frame should be fixed, i.e., users won't be able to change it.
Note that this a boolean attribute and should be written with its name as value to be XHTML compatible.
Decides how scrolling devices will be shown for this frame. Possible values (case-insensitive) are:
Decides if a border (separator) will be drawn for this frame. The value "1" tells the browser to draw a border for this frame, while the value "0" not to draw it.
Note that for two adjacent frames, both "frameborder" attributes must be set to "0" for the border between them to be invisible.
Sets the distance between the content of the frame and the left or right margin.
Sets the distance between the content of the frame and the top or bottom margin.
Its value acts as an identifier for the frame, which can be used in links and forms as value of the "target" attribute.
In XHTML 1.0 the "name" attribute for this element has been deprecated in favor of the "id" attribute and in XHTML 1.1 it's simply invalid. Therefore, its use is no longer recommended.
This element doesn't suppot events.
See a complete list and information about events in HTML
Diseño y desarrollo: Latitud29.com