|
So, you want to have a page divided up into sections, e.g. for a navigation menu? Here's how... Like Tables, frames may seem scary things at first. Al they are is combinations of 2 or more different HTM files managed by a "frameset" HTM file, which tells the browser how to, and in what order, to display these frames in a browser. You will now find out why it is that I have been getting you into the habit of right-clicking on the area of a page to view the source, as opposed to using "View" then "source" from the toolbar.This is because if you are trying to look at code on a page that has frames, doing "view source" from the main browsner toolbar will only show you the master file - the "frameset" file for the page - not the code for the individual frames themselves. To see those, you have to position your cursor in the area of the page that is the frame and right-click and view source instead. So if you want to check out people's code for frames then you'll need to remember this! Frameset file code A frameset file should be coded in a similar fashion to the below: <HTML> <HEAD> <TITLE>Frameset name<TITLE> <HEAD> <FRAMESET BORDER="x" COLS="20%","80%"> <FRAME NAME="frameone" SRC="filename.htm" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="auto"> <FRAME NAME="frametwo" SRC="otherfilename.htm" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="auto"> </FRAMESET> <NOFRAMES>
</NOFRAMES> </HTML> So what does all the stuff mean?:
Nested Frames FRAMESET element or how ever many you want, in the frameset htm file! An example is below: <HTML> <HEAD> <TITLE>Frameset name<TITLE> <HEAD> <FRAMESET BORDER="x" COLS="20%","80%"> <FRAMESET ROWS=""x, x"> <FRAME NAME="frameone" SRC="filename.htm" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="auto"> <FRAME NAME="frametwo" SRC="otherfilename.htm" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="auto"> </FRAMESET> <FRAME NAME="framethree"> </FRAMESET> <NOFRAMES> you put in information for those who haven't got frame capable browsers in here just so
they know what is going on, and what they are missing. </NOFRAMES> </HTML> Inserting the variables as discussed under attributes earlier should give you frames that look like:
Expecting there would be more were we? Well there aint! You don't need any code in
the HTML pages you want pulled into each frame (though you may need to insert a Oh, and note that you will obviously need a Floating Frames Nope, I am not referring to the effect after one has partaken of rather too much alcohol, I am talking nifty useful gizmo's here! Ever since MIExp 3.0 you have had this option. It is where the frame appears to be part of the actual web page itself, rather than in its own separate window as we have been doing them before. I will mock up a little one for you to see below: And the code I used for this: <div align=center> <IFRAME NAME="Afloatyframe" WIDTH="200" HEIGHT="200" SRC=*quot;HTMLmenu.htm"
BORDER="2" NORESIZE HSPACE="2" VSPACE="2" SCROLLING="yes"> </IFRAME> </div> So just stuff this code in with whatever variables and other attributes (as dealt with under "normal" frames at the beginning) you want, and you've done it! You do need borders, else your handywork will not be obvious! You just put in whatever filename you want. It's all as easy as that, folks! NEXT: wanna remain in good form? |