![]() Lesson 8. Further Frames. Nested Frame Sets. You can extend the notion of frames further by putting FRAMESETs within FRAMESETs. This allows you to mix rows and columns at the same time. Open the myframes.html document from the previous tutorial and make the following changes: <HTML> <HEAD> <TITLE>My Frame Set</TITLE> </HEAD> <FRAMESET rows="50%,50% > <FRAME SRC="fileone.html"> <FRAMESET cols="25%,75% > <FRAME SRC="filetwo.html"> <FRAME SRC="fileone.html"> </FRAMESET > </FRAMESET > </HTML> Here we have replaced the source of the second frame with another FRAMESET. This code splits the screen in half horizontally, loads fileone.html into the top half,splits the bottom half vertically into a quarter and three quarters, loads filetwo.html into the left (smaller) frame and fileone.html into the right (larger) one. Try it, it should look something like this: Naming Frames. <FRAME name=" "> Frames can be allocated names and it is good practice to name all frames at all times. Just add the name attribute to the <FRAME> tag. If for example you were splitting the screen vertically you might do this: <FRAME SRC="fileone.html" name="left"> <FRAME SRC="filetwo.html" name="right"> There are many good reasons for this the next section deals with the most obvious one. Linking Between Frames. <A HREF=" " TARGET=" "> </A> The main reason for naming your frames is to define them as targets for your hyperlinks. If you did not download this file in lesson 7 you may click here to do so now. Once again open the myframes.html document and make the following changes: <HTML> <HEAD> <TITLE>My Frame Set</TITLE> </HEAD> <FRAMESET rows="50%,50% > <FRAME SRC="fileone.html" name="tophalf"> <FRAMESET cols="25%,75% > <FRAME SRC="filetwo.html" name="bottomleft"> <FRAME SRC="fileone.html" name="bottomright"> </FRAMESET > </FRAMESET > </HTML> Now open filetwo.html and add the following: <HTML> <HEAD> <TITLE> filetwo</TITLE> </HEAD> <BODY BGCOLOR="#00FF00" TEXT="#000000"> <H3>File Two Content</H3> <A HREF="filetwo.html" TARGET="tophalf">Test Link</A> </BODY> </HTML> By doing these two things you have given names to each of the screen areas and created a link in filetwo.html that will load another copy of filetwo.html into the top area. Open myframes.html in your browser and click the link that you've just created, the result should be similar to that shown below.
Escaping From Frames - Special TARGET names Although you can call your frames almost anything you like there are certain names that are "reserved" in HTML for specific purposes. Preset TARGET names are..... _top - loads the link into the full browser window (great for getting people unstuck from FRAMESETs). _blank - loads the link into a new blank window. _self -loads the link into the same window. _parent - loads the link into the parent of this document. |
![]() HTML Resource Centre Lesson 6 Introducing Frames
Creating a Frameset
Further Frames
Customising Frames
Floating Frames (HTML4 Netscape 5 & Microsoft Explorer ONLY)
|