You are here:
- Manual
- Development
- Frames
- Guidelines
Guidelines for using frames
Maintaining frames on websites threatens the accessibility and sustainability of the information on these sites. That is why the use of frames is strongly discouraged.
Do not use frames on websites. This applies to regular frames in framesets as well as well as iframes.
Guideline R-pd.12.1
There are ways of ‘solving’the disadvantages of frames – ranging from client-side scripts (for instance, JavaScript) which correct the frameset and URL, to separate text-only websites. The only solution that is sufficiently adequate and sustainable is for frames on websites to be avoided or removed.
Alternatives to frames
Frames for presentation of the content
It is better to use CSS (Cascading Style Sheets) than frames for content presentation and layout. With CSS the layout of a website can be divided into rows and columns. This has the same visual effect as frames. CSS is eminently suited for sections in the layout that have to be boxed off and scrollable (a characteristic of iframes) or sections that should not scroll with the rest of the page.
CSS and tables do not have the disadvantages of frames. The exception is the separation of structure and design, which is not achieved completely when using tables for layout: therefore a layout via CSS is preferred. See also Tables for layout.
Frames for wrapping recurring content
Sometimes, web developers use frames for content that keeps recurrings (unchanged) on other pages; for example, a list with main navigation.
Server-side solutions
It is better to have the web server take care of wrapping recurring content, by means of server-side scripts – like PHP – or SSI (Server Side Includes). This technique wraps individual files on the web server sends them back to the browser as a single document, with a single URL.
Pre-processing HTML
Not every web developer has access to or experience with these server-side technologies. In that case, there is the possibility of having individual files automatically wrapped before publication. Many development programmes allow the user to apply markings to a document in order to insert another file. Before the document is placed on the web server, the programme can automatically run through all files for these labels, wrap them and save them as a definitive, wrapped version. This process is also described as pre-processing.
