Share this Page URL

Appendix . APPENDIX A HTML/XHTML Referen... > HTML 4.01 Reference (A to Z) - Pg. 189

SUNDAY MORNING Working with Frames 187 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" ""> <html> <head> <title>Two-Column Frame Layout Example</title> </head> <frameset cols="20%,80%"> </frameset> </html> Don't bother trying to check this out yet in your browser--the only thing that'll show up at this point is the title in your browser's title bar. In the FRAMESET element, the COLS attribute defines the actual layout of the columns. In this case, the left column is set to take up 20 percent of the browser's window, whereas the right column is set to take up 80 percent. To create additional columns, you just need to add them to the COLS attribute list ( cols="20%, 60%, 20%" , for instance). Just make sure that your per- centage values add up to 100. Linking to the Framed Pages The FRAME element links to the pages to be displayed in the framed windows and specifies a name that can be used to target the frame. Next, you need to use the FRAME tag to define the specific frames that form the columns of your frame page: <frameset cols="20%,80%"> <frame src="sidebar.html" name="sidebar"> <frame src="front.html" name="main"> </frameset> You'll notice that, besides the SRC attribute that specifies the content of the frame, a NAME attribute is also used to name each frame. The name of a frame can be used by links (in a sidebar menu, for instance) to control the