HyperText Markup Language/Frames

From Wikibooks, open books for an open world
< HyperText Markup Language
Jump to: navigation, search

Frames allow a section of the webpage to be constantly visible in a column or section, by having multiple pages shown in separate subwindows. Usage of frames has been deprecated in HTML 4.0, and may only be used in Transitional or Frameset mode. Frames have been replaced by a combination of Cascading Style Sheets and AJAX scripting, as they keep a more suitable method of keeping or updating content on the screen.

Framing[edit]

Frames must begin with the <frameset> tag, and end with the </frameset> tag. The frameset has optional parameters to determine the number of rows and columns along with their sizes (e.g. rows="2). A frameset tag may be nested within another tag, to allow complex frame layouts.

Within a frameset element, you can either specify a new frameset, or add the <frame> element. The frame element as the attributes src and name to specify the location of the document, and the name used for interconnection with other links.

Since some web browsers cannot display frames you must specify alternate content for these browsers in a noframes element within the frameset.

Inline frames[edit]

An inline frame begin with the <iframe> tag, and end with the </iframe> tag. As with the frame element, you can apply the src and name attributes