Chapter 4. Frames

tag, browsers,

tags for, <frameset> tags, <frame> tags, framesets, width, height, scrollbars, frames and, name attribute, <frame> tag"><script> function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); } function Print() { window.focus(); if(window.print) { window.print(); window.setTimeout('window.close();',5000); } } </script><span></span><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"></tr></table> <table width="100%" height="20" border="0" cellpadding="0" cellspacing="1"><tr></tr></table> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td align="center"><table width="95%"><tr><td align="left"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr><td valign="top" height="5"><img src="/books/2/336/1/html/2/images/pixel.gif" width="1" height="5" alt="" border="0"></td></tr> <tr> <td><b><font size="1" color ="#0000FF">Team-Fly<img border="0" src="/books/2/336/1/html/2/Fly-Logo.gif" width="81" height="25"></font></b></td> <td valign="top" align="right">     </td> </tr> </table> <hr size="1"> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td valign="top" width="67" rowspan="4"><img src="/books/2/336/1/html/2/images/0596003579/webmaster3_xs.gif" width="67" height="100" border="0"></td> <td valign="top">Webmaster in a Nutshell, 3rd Edition<br>By Robert Eckstein, Stephen Spainhour<br> </td> </tr> <tr><td>Table of Contents</td></tr> <tr><td></td></tr> <tr><td valign="bottom"> Part I:  HTML</td></tr> </table> <hr size ="1"> <br><table width="100%" border="0" cellspacing="0" cellpadding ="0"><tr><td valign="top"> <h2>Chapter 4. Frames</h2> <p> HTML frames allow you to divide the main browser window into smaller subwindows ( frames ), each of which simultaneously displays a separate document. Links in one frame can open in another frame by specifying its name as a target. All of the latest graphical browsers support frames. </p> <p> Two tags are used to make frame documents: <frameset> and <frame>. The <noframes> element provides alternative content for nonframes browsers. This is a requirement for HTML 4.0 and later and should contain functional content, or a link to it, instead of telling someone to get a browser that supports frames. </p> <p>A <span>frameset</span> is simply a collection of frames that occupy the browser's window. Column and row definition attributes for the <frameset> tag let you define the number and initial sizes for the columns and rows of frames. The <frame> tag defines what document—HTML or otherwise—initially goes into the frame, and is where you may give the frame a name to use for hypertext link targets. </p> <p>Here is the HTML source for a simple frame document, which is displayed by the browser in Figure 4-1. </p> <pre><html> <head> <title>Frames Layout</title> </head> <frameset rows="60%,*" cols="65%,20%,*"> <frame src="frame1.html"> <frame src="frame2.html"> <frame src="frame3.html" name="fill_me"> <frame scrolling=yes src="frame4.html"> <frame src="frame5.html"> <frame src="frame6.html"> <noframes> You are using a browser that does not support frames. <a href="frame1.html">Take this link</a> to the first HTML document in the set. </noframes> </frameset> </html></pre> <center> <h5>Figure 4-1. A simple six-panel frame layout in Netscape</h5> <img border="0" width="406" height="195" src="/books/2/336/1/html/2/images/0596003579/figs/wmn3.0401.gif" alt="figs/wmn3.0401.gif"> </center> <p>The first thing to notice in the sample document is that Netscape fills the frames in the frameset in order across each row. Second, Frame 4 sports a scrollbar because we told it to, even though the contents may otherwise fit the frame without scrolling. (Scrollbars automatically appear if the contents overflow the frame's dimensions, unless explicitly disabled with scrolling=no.) </p> <p>Another item of interest is the name attribute in Frame 3. Once named, you can reference a particular frame in which to display a hypertext-linked document. To do that, you add a special target attribute to the anchor (<a>) tag of the source hypertext link. For instance, to link a document called "new.html" for display in our example window Frame 3, which we've named "fill_me", the anchor looks like this: </p> <pre><a href="new.html" target="fill_me"></pre> <p>If the user selects this link, say in Frame 1, the <span>new.html</span> document replaces the original <span>frame3.html</span> contents in Frame 3. </p> </td></tr></table> <hr size="1"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr><td valign="top" height="5"><img src="/books/2/336/1/html/2/images/pixel.gif" width="1" height="5" alt="" border="0"></td></tr> <tr> <td><b><font size="1" color="#0000FF">Team-Fly<img border="0" src="/books/2/336/1/html/2/Fly-Logo.gif" width="81" height="25"></font></b></td> <td valign="top" align="right">     </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" align="right">Top</td></tr></table> </td></tr></table></td></tr></table> </frameset>


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net