Документация
HTML CSS PHP PERL другое

Creating a Frameset

 
Previous Page
Table of Contents
Next Page

Creating a Frameset

First, I want you to focus on learning how to write frameset documents. They are definitely different from the HTML pages you've been exposed to in this book so far. For starters, they use a different DOCTYPE declaration (see Example 6-1). This is the first piece of unique markup for a frame-based page.

Example 6-1. The frameset DOCTYPE declaration for XHTML 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Now things start to get really interesting! Instead of the conventional HTML structure you're by now familiar with, you won't be adding a head and a body; instead, you add a head and a frameset.

You'll be able to use the head portion the same way you would in any other documentfor title, script, or stylebut you won't have a body element because the frameset element takes its place for all framed documents. The frameset element (and its corresponding attributes, which we'll get to in just a bit) is the second piece of unique markup for a frame-based page (see Example 6-2).

Example 6-2. Frameset document structure
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Frameset Document</title>
</head>
<frameset>

</frameset>
</html>

The third unique element is the frame element, which defines which HTML pages will be placed into the corresponding frames you're creating for your page (see Example 6-3). The number of frame elements corresponds directly to the number of frames in the page.

Example 6-3. Frameset with the minimum required two frame elements
<frameset>
<frame />
<frame />
</frameset>

    Previous Page
    Table of Contents
    Next Page
    © 2000- NIV