Framesets are HTML pages that let you “embed” other HTML pages inside of them. This technique was commonplace in the late 1990′s but has since fallen out of favor for a number of reasons, including browser support, mobile device issues and the inability to (easily) link to a page within a frameset.
With that said, here’s how to create a frames page in Dreamweaver:
- Draw out your frameset on a piece of a paper before you start and make a note of how many frames you will be creating as well as their placement.
- Create a new HTML page for each frame you will be creating. Name these frames something you will easily remember. For example, if you are creating a frames page with a sidebar and a content window you can create files named “frames_sidebar.html” and “frames_content.html”. Save these files in your Dreamweaver site.
- Next, create a new HTML page but don’t save it just yet. This page will serve to “bring together” the pages you created in step 2. Click on View -> Visual Aids -> Frame borders. A black outline will appear around the edge of the canavs of your page.
- Position your mouse near the edge of your page until you see a double arrow. Click and hold your mouse to drag a new frame border into your page. You can adjust the size and position of this frame border after you’ve created it.
- If you’d like to further sub-divide your frames you can click in the panel of any of your frames and then select Modify -> Frameset -> Split Frame Up / Down / Left / Right to split your frame.
- Next, open up the Frames Panel (Window -> Frames) – you should see a visual indicator in this panel that shows the layout of your frameset.
- Click in a frame in the frame panel. Then go to the Properties panel at hte bottom of the screen and click the Browse button next to the “source frame” field. Browse and find the HTML file that you want to initially appear in that frame. Repeat this process for each frame on your page. Here’s a quick video that goes through this entire process.
- Finally, click on the outside border of your frameset in the Frames panel. This will draw a thick black box around your entire frames page. With this visible, click the Save button and save your frameset as a new file (i.e. “frames.html”)
Frames and Hyperlinks
Hyperlinks behave differently inside a frameset. Unless instructed to do otherwise, hyperlinks will open up inside their contianing framset. You can override this behavior by setting up “names” for your frames and using the “target” attribute of the hyperlnk tag to control where the hyperlink will open. Here’s how to get started:
- Make sure the Frames panel is open and that you are viewing your frame page in Dreamweaver.
- Click on a frame in the Frames panel
- In the properties panel fill in the “name” blank for this frame
- Repeat this process for each frame
- When you create hyperlinks you can select the name of your frames from the dropdown list under the “target” attribute. This lets you tell the browser what frame should open up the link in question.
- If you want to create a link that overwrites the entier frame (i.e. takes the user away from your frames page) you can use the “_top” target.