You may want the contents of your floating frame to display aligned with the top and left sides of the floating frame. To do this, place TOPMARGIN and LEFTMARGIN attributes in the BODY tag of the page that will be displayed in the floating frame: <BODY TOPMARGIN=0 LEFTMARGIN=0> To offset the frame's contents by 10 pixels down and to the right, use TOPMARGIN=10 LEFTMARGIN=10. |
To make the frame a different size, change the WIDTH and HEIGHT. You can also use percentage values. The following will insert a floating frame that is half the height and width of Internet Explorer's content area: <FRAME WIDTH=50% HEIGHT=50% SRC="http://www.microsoft.com"> |
This is especially useful in combination with FRAMEBORDER=0. Note that the contents of the frame will not be scrollable, not even by using the arrow keys. |
As with right-aligned images, subsequent text and other contents will be drawn to the right of the frame. To skip past the bottom of the frame, insert the following into your page: <BR CLEAR=RIGHT> or <BR CLEAR=ALL> |
Addressing Floating Frames by NameYou can name your floating frames so that when a user clicks a link in your page, new content will show up in a floating frame on that page. Here's an example:<FRAME WIDTH=100 HEIGHT=100 SRC="page1.htm" NAME="MyFrame"> ... <A HREF="page2.htm" TARGET="MyFrame"> Click here to see Page 2 in the floating frame. </A> When the user clicks the link, the file page2.htm will show up in the floating frame. |
Big Brother is Watching Your FishUsing floating frames in combination with client pull gives you a window on your Web page that updates regularly without refreshing the entire page.For example, let's say you have a video camera pointed at your fishtank. It sends new images of your fish to your Web server once every 30 seconds, where they can be viewed at http://www.mycompany.com/latestfish.gif. To put a regularly updating view of your fish on your Web page, first create another page to contain the fish image. We'll say the address of this page is http://www.mycompany.com/fishpage.htm. <HTML> <HEAD> <META HTTP-EQUIV="REFRESH" CONTENT="30; URL=http://www.mycompany.com/fishpage.htm"> <TITLE>My Fish</TITLE> </HEAD> <BODY TOPMARGIN=0 LEFTMARGIN=0> <IMG WIDTH=100 HEIGHT=100 SRC="http://www.mycompany.com/latestfish.gif"> </BODY> </HTML> (Those familiar with the client pull technique will recognize the third line as the one that makes the page refresh every 30 seconds.) Now, simply place a floating frame pointing to the new page into your Web page: <FRAME WIDTH=110 HEIGHT=110 FRAMEBORDER=0 SRC="http://www.mycompany.com/fishpage.htm"> From now on, visitors to your Web site will know more about your fish than you do. Because a floating frame can contain any HTML document, this technique is useful not just for fishtanks and weather maps, but also for such things as stock quotes, on-line chats, and so on. |
Back to the HTML Authoring Features page