Using Frames


Dreamweaver makes it relatively easy to use frames. You do not need to program framesets and frames by hand. Most of the frame properties can be set by clicking property boxes. We will create a document with frames.

What Are Frames?

Frames are separate windows that appear inside a web page. Each frame is made up of a separate HTML page.

In addition to the individual HTML pages that make up the web page with frames, there is another HTML page that doesn't display. It is called the Frameset. Its purpose is to direct the display of the pages that make up the web page with frames.

Even though the Frameset doesn't display, it is obviously very important to a web page that uses frames.

Creating Frames

blue arrowOpen a new  Dreamweaver window by clicking the File menu, New. 

blue arrowFrom the View menu, select Frame borders to show the frame borders.  A strong outline appears around the inside of the document window. These are the frame borders. You will use the frame borders to create the frames. 

blue arrowHold down the Alt key, place the mouse over the left border and drag the left hand border toward the right.  Make the left frame narrower than the right.

blue arrowClick inside the right hand frame to select it.  From the Modify menu, select Frameset, then Split Frame Down.  A new frame border will divide the right hand frame into top and bottom.  Now there are three frames.

Selecting Frames and Framesets, Adding Text

Selecting a Frame

To select a frame so that its properties can be modfied, press the Alt key and click inside the frame. A dotted line surrounds the inside of the frame that is selected. The HTML of that frame (page) is visible in the HTML inspector window.

Selecting the Frameset

To select the frameset, click on a frame border. The HTML of the frameset document is visible in the HTML inspector window.

blue arrowClick inside the top frame and type and format some text for a web site title. 

blue arrowClick in the left most frame and type some index text.

blue arrowClick in the main frame and type some text.

Saving Frames and Framesets

Remember that the frameset document does not display information on the screen.  It is the file that specifies the format of the frames that actually contain the data.  Dreamweaver automates the process of creating a frameset.

blue arrowTo save a frameset file, choose File, Save Frameset As. You will be prompted for a name. Many framesets are called index.html, because their information is used to display the framed pages.

blue arrowTo save a frame document, click in a frame and choose File, Save. You will be prompted for a name.

Naming Frames

To be able to target documents into frames, it is important to give frames names.

The name of a frame is different from the name of the HTML file. Every HTML file has a file name, but not every HTML page has a name associated with a frame.

blue arrowUse the Property editor to name frames. Alt click the frame you wish to name. The property editor will change to reflect the properties of the frame.

blue arrowOn the left side an empty box called Frame Name. Type a name.

It is always best to select a descriptive name for the frames you create.

blue arrowUse the frames Property editor to specify other properties of the frame as well. Such as scroll bars, resize or no resize, borders, border color and margins.


blue arrowAlt click inside each of the three frames.  The Property Box now shows the frame properties.  Name each frame by typing a name in the blank box underneath the word "Frame". 

blue arrowSave each individual frame as left.html for lefthand frame, top.html for the top frame, and "main.html" for the largest frame. 

blue arrowSave the frameset for your document as frameset.html

blue arrowNotice that the Property Box allows you to change other properties such as border color, etc.

Using Links in a Frame

Often the left frame is used as an index that remains visible, while the big frame changes content when one of the links in the index is clicked. 

This link shows an index frame on the left.  Clicking one of the topics causes the main frame to load a new document.  Dreamweaver can help with the details of "targeting" a document to a particular frame.

Targeting is very important. If links inside framed documents are not targeted correctly, you might have the awkward situation where a large document is loaded into the small menu frame on the left side!


blue arrowSelect some text in the left frame. 

blue arrowIf the Properties Box is not open, open it from the Window, Properties menu.

blue arrowIn the link box, type in the URL of a page that you would like to load in the main frame.  For example, you could type to load Yahoo's main page into the main window. 

blue arrowNow, in the Target drop down box, select the main frame to target the new document into the main frame. 

blue arrowFrom the File menu, select Save All.  Try your  frame from the File menu, select Preview in browser.