![]() |
<frameset> The <frameset> tag signals the start of a set of frames. A set of frames contains rows or columns or rows and columns.
You can specify the sizes of rows and columns in different ways:
I will now explain the different types. Type i) specifies the size of the frame as a percentage of the browser window. Type ii) specifies the size of the frame in pixels. Type iii) specifies the size of the frame in proportional value. 3* is three times bigger than * which means that that frame will be 3 times bigger than the other.
absolute values are taken in to account first, percentages are then based on the whole window, proportional values are then measured from the remaining space
The combinations can become kind of tricky. I will explain now the results of the three combinations above. |
![]() |
NOTE: WITH ROWS YOU ARE SPECIFYING THE HEIGHT AND WITH COLUMNS YOU ARE SPECIFYING THE WIDTH To tell the browser that the frameset contains rows type: <frameset rows= "100,*"> To tell the browser that the frameset contains columns type: <frameset cols= "*,3*"> To tell the browser that the frameset contains rows and columns type: <frameset rows= "100,*" cols= "*,3*> <frame> The frame tag has no end tag. There must be one frame tag for each frame. If there are two frames specified in the <frameset> tag then there must be two <frame> tags before the </frameset> tag. The only required attribute of the <frame> tag is "src=". This is where you enter the URL of the HTML document that will fill that frame. Absolute or relative reference can be used. To help explain this you should refer back to Notepad Viewer 10.1. In this document I presumed that" menu.html", "title.html" and "main.html" were in the same folder as "notepad10-1.html".
This is a very basic frameset container, which has two rows. What if I wanted to separate the bottom row into two columns (Explorer View 10.1)? There are two ways to do this.
The first way is explained in Notepad Viewer 10.1 but I will try to make it clearer for those who do not understand. Notepad Viewer 10.2 specifies two rows in the frameset tag. The first row is set to display the contents of "top.html". The second row is set to display the contents of "bottom.html". The first step in changing this document to the way we want is removing the tag <frame src= "bottom.html">. The second step is replacing it with: <frameset cols= "20%,*> <frame src= "bottomleft.html"> <frame src= "bottomright.html"> </frameset> Its as easy as that. To see the complete listing, go back to Notepad Viewer 10.1. The second way is also quite easy. This time instead of removing "bottom.html" we edit it. Its source should read: <html> <frameset cols= "20%, *"> <frame src= "bottomleft.html"> <frame src= "bottomright.html"> </frameset> </html> Both ways will have the same result. Its up to you which one you use. You should now be able to create any combination of frames. Study this Notepad Viewer of very complicated frames. Try to sketch on a piece of paper what you think the finished page will look at. Then click on the anchor underneath to see if you were right.
|
![]() |
Explorer View 10.2- result of Notepad Viewer 10.3 Although the above is not an ideal layout for a webpage it displays the flexibility of frames and the ways in which they can be used to lay out your page almost any way you want. You can see above the way frames look when they have content (even if it is only one number). What would happen though if you specified either an unknown URL or no URL at all? Explorer View 10.3 shows both of these. The top frame has no URL reference at all i.e. <frame> The bottom frame has an unknown URL i.e. <frame src="unknown URL"> Explorer View 10.3 - click on the
image to see a bigger and clearer version This is the way they are presented in Internet Explorer 4, Internet Explorer 3 however displays just an empty grey box for an unknown URL. The frame with no URL will display the same in IE3 as in IE4. attributes So far the only attribute you know for the <frame> tag is "src=". I will firstly show you a <frame> tag with all of its attributes and then I will explain each of them to you. <frame src= "main.html" marginheight=6 marginwidth=4 bordercolor=black scrolling=auto noresize> marginheight sets the internal top and bottom margins in pixels marginwidth .sets the internal left and right margins in pixels bordercolor .. sets the colour of the frames borders in rgb value or in one of the set colours |
![]() |
scrolling .can be set to yes, no, or auto. It gives information to the browser about using scrollbars with that frame, yes means there will be whether necessary or not, no means there wont be even if they are necessary, auto is the default and means that there will be if they are necessary but not if the entire document will fit in the frame. noresize .if this is set then the frame can not be resized by the viewer The following is a <frameset> tag with all of its attributes. <frameset rows= "*,*" cols= "*,*" border=4 frameborder=yes bordercolor=red> border .sets the thickness of the borders in that frameset in pixels the default is 3 frameborder can be set to yes or no, if no is selected then the borders do not have a 3D effect and are just plain lines bordercolor ..is the same as it is in the <frame> tag except in this case it sets the colour for the entire frameset |
|
NOTE: IF TWO TOUCHING FRAMES HAVE A DIFFERENT FRAME COLOUR THE DEFAULT COLOUR (USUALLY GREY) IS USED To create borderless frames set "border=0" and "frameborder=no" linking to another frame Quite often you will have an anchor in one frame but want the page to open in another. This process can be made sound complicated but it is really quite simple. i) name the frame You can assign a name to a frame in the <frame> tag. Simply include the attribute "name=". There is only one restriction when assigning a name and that is that it cannot start with an underscore ("_"). ii) target that frame To target an anchor to a different frame the anchor tag should look like this. <a href= "whatever.html" target= "theframename">. The only restriction you have when targeting a frame is that the frame must be visible when the anchor is clicked. There are 4 other reserved implicit frame names. The following is a list of them and a description of what they do: |
![]() |
If you are careful and think ahead when defining your framesets you will be able to update different variations of frames. For example;
This is a picture of the original page, click on the image to see a bigger and clearer version: |
![]() |
The document that resulted in this page was called "work.html", this document was a frameset document and set two rows, the first row was to contain the file "title.html" and the second row was to contain the file "main.html". "Main.html" was itself a frameset document and it set two columns, the first contained the file "menu.html" and the second contained the file "body.html". "Body.html" was named "nestedframeset" and had two columns, the first contained the file, "info.html" and the second contained the file "guide.html". The anchor in "menu.html" read: clicking<a href= "newmaterial.html" target= "nested frameset">here</a> Therefore when "here" was clicked, the two frames on the right, which make up "body.html" are replaced with "newmaterial.html". Look below if you do not fully understand, click on the image to see a bigger and clearer version |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
frameless glasses Not all browsers however support frames so what will you do about that? You can use the <noframes> tag to either give a polite apology that they cannot see your pages or to provide alternative HTML code and give the unfortunate people a chance to see your pages. The <noframes> and </frames> tags signal the start and end of alternative html for browsers that do not support frames. There is no need for the <html>,<body>,</html> or </body> tags, but if you want to use the attributes of the <body> tag you must include it. Notepad Viewer 10.4 displays how to use the <noframes> tag.
EXTRA INFO. This information is relevant to links but also to links between frames: It is possible to link to a section of a document. Firstly you must name the section, just like you do when you want an internal link. Then you alter the anchor so as it looks like this: <a href= "mypage.html#mysection"> When using frames you could use the anchor like this: <a href= "mypage.html#mysection" target= "myframe">
![]() next lesson  home  comment  more downloads  download this |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
It is important that you pay attention now. Major changes are about to happen to your HTML Builder. By adding frames we are going to completely change the structure of the page.
You will need two images to complete the html builder titanic_head.gif and proudm.gif. If you have downloaded this tutorial then you already have the files, if you haven't then you will have to download them now. Right-click on the links and choose "save target as..." or "save link as...", whichever appears (it will depend on your browser). Save the pictures in the same folder as your html builder file.
The next thing you must do is create the file
"index.html" in the c:\html directory. The source
should look like this. Notepad Viewer- HTML Builder 7.1(index.html)
As you can see above we now require 3 more documents and here are the notepad viewers of each of them. Notepad Viewer- HTML Builder 7.2 (title.html)
Notepad Viewer- HTML Builder 7.3 (menu.html)
Notepad Viewer- HTML Builder 7.4 (imagemap.html)
You may have noticed a couple of links to the file "detailed.html". This is simply the menu that used to be at the top of the page. You will have to highlight everything between the <table> and </table> tags, cut it and paste it into a new file, add the <html> and <body> tags with the same attributes as "builder.html", update the links because they now lead to a different document and add the section for Lesson 7. When you are finished the source will be: Notepad Viewer- HTML Builder 7.5 (detailed.html)
You will also have to update the document "builder.html". Notepad Viewer- HTML Builder 7.6
This page was designed for on a monitor set to 800x600 resolution. It is therefore best viewed with that resolution. This is what it looks like on a monitor with resolution set to 800x600 . Explorer View- HTML Builder 7 -
click on the image for a bigger and clearer version ![]() next lesson  home  comment  more downloads  download this |
This
document was last modified by the author (above) on 5/12/1998
© copyright 1998