Ou Courses  Banner ADBH Web - HTML Help - Frames
ADBH Web 08-Aug-2008

HTML Help - Frames

Frames

Frames are not really for people just starting out with HTML, they can get quite hairy when switching content.

<frameset></frameset> Code between these defines the frameset.

<frame> Sets up a frame within a frameset

<noframes></noframes> Older browsers do not support frames, in this section it is normal to put a message to that effect and possibly redirect the user to part of the site that does not use frames.

<Frame src="URL"> Sets which HTML document is initially shown when the frameset is opened

<frame name="name"> Gives the frame a name so it's easier to remember which is which

<frame marginwidth=?> Left and right margins for the frame

<frame marginheight=?> Top and bottom margins for the frame

<frame scrolling=value> Allows for a scrollbar to be visible values =Yes, no or auto

<frame noresize> Stops the user from resizing your frame

How the code looks when is all put together, the code is from this frame set:

<frameset cols="100%" rows="73,*" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" src="header.htm" >
<frameset cols="120,*" rows="*" frameborder="NO" border="0" framespacing="0">
<frame name="mainFrame" src="index.htm" scrolling="YES" >
</frameset>
</frameset>
<noframes>
<body bgcolor="#00FF00" text="#000000">
<p align="center">This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>

The Frameset make up

topFrame

<frame name="topFrame" scrolling="NO" src="header.htm" >

frame name = "topFrame" and the src = "header.htm instructs the browser that the page header is to be displayed in the topFrame of the frameset

leftframe

<frame name="leftFrame" scrolling="AUTO" noresize src="intro_nav.htm" >

frame name = "topFrame" and the src = "intro_nav.htm instructs the browser that the pageintro_nav.htm is to be displayed in the leftFrame of the frameset

mainframe

<frame name="mainFrame" src="index.htm" scrolling="YES" >

frame name = "mainFrame" and the src = "index.htm instructs the browser that the page index.htm is to be displayed in the mainFrame of the frameset.

NOTE: The page names specified are the default pages that will appear when the frameset is initially opened.

To display other pages in the frameset such as the page you are now viewing you will require a link to the page - this framset uses the lefthand navigation frame and links within the main content pages to acheive this. When making your link you need to instuct the browser in which frame it is to open the new page, this is done by adding the target attribute to the page link. All the content pages in this frameset are set to open in the mainFrame.

<a href="frames.htm" target="mainFrame">Frames</a><br>

 

Top of Page

 

 

 

Page built in 0.0006 seconds