This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Frame" World Wide Web – news ·newspapers ·books ·scholar ·JSTOR(January 2008) (Learn how and when to remove this message) |
| HTML |
|---|
| HTML and variants |
| HTML elements and attributes |
| Editing |
| Character encodings and language |
| Document and browser models |
| Client-side scripting and APIs |
| Graphics and Web3D technology |
| Comparisons |
In the context of aweb browser, aframe is a part of aweb page or browserwindow which displays content independent of its container, with the ability to load content independently. TheHTML or media elements in a frame may come from aweb site distinct from the site providing the enclosing content. This practice, known asframing,[1] is today often regarded as a violation ofsame-origin policy.
InHTML, aframeset is a group of named frames to which web pages and media can be directed; aniframe provides for a frame to be placed inside the body of a document.
Since the early 2000s, concern for usability and accessibility has motivated diminished use of framesets and theHTML5 standard does not support them.
The frames in HTML are created using the<frameset></frameset> tag pair. The<frameset> tag is a container tag for all other tags that are used to create frames. The<frameset> tag replaces the<body> tag in frameset documents.The<frameset> tag defines how to divide the window into frames.
Each frameset defines a set of rows or columns. If user define frames by using therows attribute then horizontal frames are created. If user define frames by usingcols then vertical frames are created.
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:
<framesetcols="85%, 15%"><framesrc="http://www.example.com/frame_1.html"name="frame_1"><framesrc="http://alt.example.com/frame_2.html"name="frame_2"><noframes> Your browser does not support frames.<ahref="http://www.example.com/frame_1.html">Click here</a> to view frame 1.<ahref="http://alt.example.com/frame_2.html">Click here</a> for frame 2.</noframes></frameset>
Framesets have aborder attribute. If set to an integer greater than 0, the user can resize the frames by dragging this border, unless anoresize attribute is present in a frame element. If border is set to 0, no border will be displayed and content in different frames will abut each other without delineation.
Theiframe element is used inline within a normal HTML body, and defines the initial content and name similarly to theframe element. Any text inside an<iframe></iframe> tag pair will be displayed in browsers that do not understand the iframe tag.
<iframesrc="http://www.example.com/frame_1.html"height="480"width="640"> Your browser does not support iframes.<ahref="http://www.example.com/frame_1.html">Click here</a> to view the content.</iframe>
This sectionneeds expansion. You can help byadding to it.(January 2008) |
Netscape Navigator 2.0 introduced the elements used for frames in March 1996. Other browser vendors such asApple withCyberdog followed later that year.[2] At that time, Netscape proposed frames to theWorld Wide Web Consortium (W3C) for inclusion in the HTML 3.0 standard.[3]
Frames were used to display and navigate earlyonline magazines andweb apps, such aswebmail services andweb chat sites. Frames had the advantage of allowing elements to be displayed sitewide without requiring server features such asserver-side includes orCGI 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 asadvertising.[4]
XHTML 1.1, the intended successor to HTML 4, removed all frames.XFrames, the intended eventual replacement,[5] provided the compositeURI to address a populated frameset.
The laterHTML5 standard removed framesets by means differing from XHTML.[6] Theiframe element remains with a number of "sandboxing" options intended for sharing content between sites.[7]
By allowing content to be loaded and navigated independently, frames offered several advantages over the plain HTML in use when they were first developed:
The practice of framing HTML content led to numerous criticisms, most centering onusability andaccessibility concerns. These include:
Frames create both technical and user-interface difficulties for enforcement of thesame-origin policy. As an example of the latter, an outer page can trick a user into performing an action on an inner page (loaded using the iframe element) which has been made 99% transparent.
As web technology developed, many of the purposes for which frames were used became possible in ways that avoided the problems identified with frames.
overflow property) or held on screen while other content is scrolled (usingposition:fixed)What makes framing different is that instead of taking the user to the linked website, the information from that website is imported into the original page and displayed in a special "frame". Technically, when you're viewing framed information, your computer is connected to the site doing the framing—not the site whose page appears in the frame.