Click
here for an example of a frame.
Click here for another example.
Here is an example of a real example.
The seperate HTML documents needed to display the
frames is held together by a
single frameset document.
<HTML>
<HEAD><TITLE>A Simple Frame</TITLE></HEAD>
<FRAMESET COLS="*,*">
<FRAME SRC="Lab4.html">
<FRAME SRC="Lab7.html">
</FRAMESET>
<NOFRAMES> Your browser does not support frames </NOFRAMES>
</HTML>
Here is what you get if your browser does not support
frames. (Click
here)
Using Rows Instead of Columns
Here is a simple example (Click
here) using the rows *.* uses default sizes of the frames.
It is a good idea to include comments to identify the
frames usage.
<HTML>
<HEAD>
<TITLE> ReFrame </TITLE>
</HEAD>
<FRAMESET ROWS="*,*"
>
<! ---- Use this frame for the
top Row >
<FRAME SRC="lab6.html">
<! ---- Use this frame for the bottom hand side >
<FRAME SRC="Lab7.html">
</FRAMESET>
</HTML>
Border Control
Like tables you can control the size of your borders.
Here is an example
with no border (Click
here).
<HTML>
<HEAD>
<TITLE> ReFrame </TITLE>
</HEAD>
<FRAMESET BORDER=0, ROWS="*,*" >
<! ---- Use this frame for the top Row ><FRAME SRC="lab6.html">
<! ---- Use this frame for the bottom hand side >
<FRAME SRC="Lab7.html">
</FRAMESET>
</HTML>
Why Would You Create A Border=0?
Here is an example of why you might want to do this. (Click
here.) Note that you can
set ROWS or COLS to a size from 100-1%, or absolute pixel
size.
For example :
<HTML>
<HEAD>
<TITLE> frame3 </TITLE>
</HEAD><! Use the ROWS=15% to create a narrow navigation bar >
<FRAMESET BORDER=0 ROWS="15%,*" ><! ---- Use this frame for the top Row >
<FRAME SRC="Welcome1.html">
<! ---- Use this frame for the bottom hand side >
<FRAME SRC="Welcome2.html">
</FRAMESET>
</HTML>
Here is the content of the document document1.html.
(Note
if this was an actual document
I would set each URL to something different.)
<HTML>
<HEAD>
<TITLE> frame3 </TITLE>
</HEAD>
<BODY BGCOLOR="silver">
<TABLE WIDTH=100%>
<TR>
<TD>
<A href="http://wwww.depaul.edu/~dlash"> HOME </A>
<TD>
<A href="http://wwww.depaul.edu/~dlash"> SITE INDEX </A>
<TD>
<A href="http://wwww.depaul.edu/~dlash"> SPORTS PAGE </A>
<TD>
<A href="http://wwww.depaul.edu/~dlash"> COMICS </A>
</TABLE>
</Body></HTML>
Nesting FramesNesting frames is putting a frame within a frame. Here is an example of how you do this. (Click here.)
<HTML>
<HEAD>
<TITLE> A Nested Frames Example </TITLE>
</HEAD><!-- cols for vertical divisions -->
<FRAMESET COLS="*,*" ><!-- left frame -->
<FRAME SRC="Lab6.html"><!-- right frame is another frameset -->
<!-- rows for horizontal divisions -->
<FRAMESET ROWS="*,*">
<!-- top frame -->
<FRAME SRC="Lab4.htm">
<!-- bottom frame -->
<FRAME SRC="Lab7.html">
</FRAMESET></FRAMESET>
</HTML>
The following is an example of setting up a navigation frame. (Click Here.)
Here is an the source for links1.html
<HTML>
<HEAD>
<TITLE> Frames Example </TITLE>
</HEAD><!-- cols for vertical divisions -->
<FRAMESET COLS="130,*" BORDER=0><!-- left frame -->
<FRAME SRC="links1.html" NAME=left><!-- right frame is another frameset -->
<!-- rows for horizontal divisions -->
<FRAMESET ROWS="33%,*"><!-- top frame -->
<FRAME SRC="h.html" NAME=upper><!-- bottom frame -->
<FRAME SRC="i.html" NAME=lower></FRAMESET>
</FRAMESET>
</HTML>
<BODY BGCOLOR="#FFFFCC"><H1 ALIGN=CENTER>
Links </H1>
<A HREF="a.html" TARGET="lower">The "A" page</A>
<BR>
<A HREF="b.html" TARGET="lower">The "B" page</A>
<BR><A HREF="c.html" TARGET="lower">The "C" page</A>
<BR><A HREF="d.html" TARGET="lower">The "D" page</A>
<BR>
</BODY>
Frameset has the following attributes:
<frameset> .... </frameset>
Consider the following frame set -
click here
<HTML>
<HEAD>
<TITLE> Frames Example </TITLE>
</HEAD><!-- cols for vertical divisions -->
<FRAMESET COLS="130,*" BORDER=0><!-- left frame -->
<FRAME SRC="links2.html" NAME=left><!-- right frame is another frameset -->
<!-- rows for horizontal divisions -->
<FRAMESET ROWS="75,*">
<!-- top frame -->
<FRAME SRC="titlebar.html" NAME=titlebar><!-- bottom frame -->
<FRAME SRC="h.html" NAME=lower>
</FRAMESET></FRAMESET>
</HTML>
Now change the following couple of lines and get the
following -
click here.