Framing (World Wide Web)

In the context of a web browser, a frame is a part of a web page or browser window which displays content independent of its container, with the ability to load content independently. The HTML or media elements that go in a frame may or may not come from the same web site as the other elements of content on display.

In HTML, a frameset is a group of named frames to which web pages and media can be directed; an iframe provides for a frame to be placed inside the body of a document.

Since the early 2000s, the use of framesets has increasingly been considered obsolete due to usability and accessibility concerns, and the feature has been removed from the HTML5 standard.

Syntax

The HTML 4.0 standard included two different forms of frame, frame element, used inside a special frameset container, and the iframe element, used within the body of a document.

In HTML 4.01, a document, which would normally contain a head and a body, may instead contain a head and a frameset (but not both a body and a frameset). The attributes rows and cols on the opening frameset tag define the dimensions of a grid of frames using comma-separated lists of sizes, specified in either pixels or percentages. Any row or column size may be replaced with an asterisk to indicate the remainder of the remaining screen space.[1] Within the frameset, a series of frame elements describe the initial source documents for each frame in the frameset, as well as assigning them names for use as the target of links. The <noframes> element may be included so web browsers with frames disabled (or browsers that do not support frames) can display something to the user, as in this example:

<frameset cols="85%, 15%">
  <frame src="http://www.example.com/frame_1.html" name="frame_1">
  <frame src="http://alt.example.com/frame_2.html" name="frame_2">
  <noframes>
    Text to be displayed in browsers that do not support frames
  </noframes>
</frameset>

The iframe element is used inline within a normal HTML body, and defines the initial content and name similarly to the frame element.

History

Netscape Navigator 2.0 introduced the elements used for frames in March 1996. Other browser vendors such as Apple with Cyberdog followed later that year.[2] At that time, Netscape proposed frames to the World Wide Web Consortium (W3C) for inclusion in the HTML 3.0 standard.[3]

Frames were used to display and navigate early web apps, such as web chat sites and online magazines. Frames had the advantage of allowing elements to be displayed sitewide without requiring server features such as server-side includes or CGI support. These features were not common on early web servers accessible to the public.

Early websites often used a frame at the top to display a banner which could not be scrolled away. These banner frames sometimes included the site's logo as well as advertising.[4]

XHTML, intended as a successor to HTML 4, removed all frames in 1.1. The intended eventual replacement was XFrames,[5] which attempts to solve the problem of addressing a populated frameset through composite URIs.

The later HTML5 standard, which took a different approach to succession from HTML 4, also removes framesets.[6] The iframe element, however, remains, with a number of "sandboxing" options intended for sharing content between sites.[7]

Advantages

By allowing content to be loaded and navigated independently, frames offered several advantages over the plain HTML in use when they were first developed:

Criticism

The practice of framing HTML content led to numerous criticisms, most centering on usability and accessibility concerns. These include:

Alternatives

As web technology developed, many of the purposes for which frames were used became possible in ways that avoided the problems identified with frames.

Not all of problems identified with framesets are eliminated by using these alternative approaches; for instance issues with Back/Forward navigation, bookmarking, and indexing remain on many sites which make heavy use of DHTML / AJAX navigation.

See also

References

  1. "Frames in HTML Documents". W3C.
  2. Garaffa, Dave (23 December 1996). "A Present From Apple: Cyberdog 2.0a1" (Press release). Internet.com. Archived from the original on 17 August 2000. Retrieved 14 April 2011.
  3. Ladd, Eric. "Using HTML 3.2, Java 1.1, and CGI; Ch. 13, Frames". Archived from the original on 30 October 2007.
  4. Shafer, Dan (1996). JavaScript & Netscape wizardry. Scottsdale, AZ: Coriolis Group Books. p. 31. ISBN 978-1-883577-86-5.
  5. "XFrames working draft". W3C.
  6. HTML 5 differences from HTML 4: "The following elements are not in HTML 5 because their usage affected usability and accessibility for the end user in a negative way: frame, frameset, noframes"
  7. HTML 5 differences from HTML 4: "new sandboxing features for iframe"
  8. "Framesets".
  9. 1 2 Nielsen, Jakob (December 1996). "Frames Suck Most of the Time".
  10. "Should You Use Frames?". HTML Code Tutorial.
  11. "G.E.Boyd's How To Do Just About Anything by email – Part 1". GeoCities. 11 August 2000. Archived from the original on 17 August 2000. Retrieved 24 June 2010.
  12. Moore-Eded, Piers. "SEO fundamentals 1". Lewes SEO. Retrieved 25 February 2012.
  13. "I Hate Frames Club".
  14. 1 2 "Why are frames so evil?".
  15. 1 2 "The Pros and Cons of Frames in Web Pages".
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.