Frames


On a webpage, frames are self-defined areas within the page. Each segment can contain its own HTML document. Frameset refers to the entirety of frames contained in a webpage. The content may be defined statically, alternating, or scrollable. The decisive factor is the independence of the individual segments.

Code elements

For files which contain frames, the document type declaration must specify such.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">

Furthermore, such a file does not include a body element. Following the <Head> is a <frame> or a whole <frameset>. A <noframes> area is possible and useful. It can even be seen by visitors, whose browser doesn’t support frames. It is helpful for search engines as well.

An example:

…
<html>
<head>
<title> Displays the same for all frame content!</title>
</head>
<frameset cols=”250,*”>
	<frame src=”navigation.htm” name=Navigation”>
	<frame src=”start.htm” name=”content”>
	<noframes>
		<body>
			<h1>Welcome</h1>
			<p>We use frames, which are unfortunately not being displayed to you. <br>
                         These pages can be reached on an alternate route:<br>
			<a href=”navigation.htm”>Navigation</a><br>
			<a href=”start.htm”>Start page</a><br>
			<!--other--></p>
		</body>
	<noframes>
</frameset>
</html>

Sensible areas of application

  • Frames are very useful for comparisons. Information from different pages can be displayed to visitors simultaneously by loading a different HTML page in each frame. That way users can decide for themselves what information they want to have on the page to compare directly. Data can be combined and displayed flexibly.
  • A sensible use of frames is the division into a directory with clickable elements and in a separate frame in which each page is displayed. Users can have a good overview that way and don’t have to constantly jump back to the master directory.
  • Frames can be helpful to permanently show visitors certain references even for very large pages. Visitors can therefore more easily navigate through the pages and not lose track.

Criticism

The use of frames has some disadvantages. You have to take all aspects into consideration before utilizing frames.

  • Screen resolution: In the case of small screens, too many frames harm the overview because it will quickly become confusing. Especially in mobile devices, only a small display area is available.
  • Load times: More HTTP requests have to be sent as more files have to be loaded. This increased communication will be reflected in a longer wait time. However, it is also possible to fix the menu and other elements with frames, so these elements will not have to be reloaded for each page of the website in question. This in turn reduces the load time.
  • Non-frame-enabled browser: It cannot be blankly assumed that each browser supports frames. If a browser is used that does not support frames, the user will not be able to see the frames on websites. He has no other way to display the content. The use of the noframes tags is only a partial solution and conversion loss should be expected.

Accessibility

Screen readers are generally able to interpret frames. However, a few factors must be taken into account when implementing frames.

One function of frames is the sensible, visual layout of the screen. It must be usable for output media which is one-dimensional and not visual. The number of frames plays a major role in this instance. If there are too many, tracing the page structure via a screen reader will be very difficult. Also for mobile devices, a high number of frames add to confusion.

There will also be an accessibility problem when document types other than HTML are being integrated into frames. If alt text is not added to a graphic in a frame, for example, it will not be detectable by a screen reader. An image in an HTML element, on the other hand, can be described by the ALT attribute as precise as you want.

Relevance to search engine optimization

The recording of frames is not a trivial matter for search engines. Normally a website is part of a URL. In frames, however, each frame has its own URL because they are individual HTML pages. By its own statement, Google tries to correct the content in frames. However, it is not assured that the frame will always be valued for the website on which the frame is integrated.

Since nowadays, many visitors surf the web via mobile terminals the corresponding disadvantage of frames is quite significant. If there are a lot of frames on a webpage and it is very difficult to navigate, you will leave the site quickly. The rate of conversions can therefore be adversely affected by frames because visiting the site is uncomfortable.

Generally, it is recommended to switch to alternate design options. CSS offers a large range of options, for example. Frames is no longer suitable. Responsive designs will in the future, play a much more significant role. In this case the layout automatically adjusts to the device being used.