<frameset> Creating Documents with FramesYou use the <frameset> element when you want to display frames in a document. The <frameset> element replaces the <body> element in such documents; in XHTML 1.0, that means you use the XHTML 1.0 Frameset DTD. This element is supported in XHTML 1.0 Frameset only. The <frame> and <frameset> elements are not supported in XHTML 1.1; the XHTML 1.1 DTD does not makes any mention of these elements or of frames at all, and these elements are specifically listed as unsupported in XHTML 1.1. Why aren't frames supported in XHTML 1.1? They're not supported because W3C expects stylesheets to handle the presentation techniques that you use frames for today. Whether the Web community will ultimately accept that is anyone 's guess. Here are the attributes of this element:
This element supports no XHTML events. You use the <frameset> element and the XHTML frameset DTD to format a page into frames. This element takes the place of the <body> element in documents that display frames. To create the frames themselves , you use the <frame> element. To format the display into frames, you use the rows or cols attributes of the <frameset> element. You indicate the number of rows or columns you want to use by giving their heights or widths in a comma-separated list. To specify those heights or widths, you can give pixel measurements or a percentage measurement (such as "40%" ) to request a percentage of the available display area. If you use an asterisk, the browser will try to give you the remaining display area; for example, cols="200, *" creates one vertical frame of 200 pixels and a second vertical frame filling the remainder of the display area. I recommend using percentage measurements rather than pixel measurements because the user may resize the browser window, unless you're using wide graphics or table with set widths. For example, here's how I creates two columnsthat is, two vertical frameseach of which take up half the available width (note that I'm using the XHTML 1.0 Frameset DTD): <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> Using XHTML Frames </title> </head> <frameset cols = "50%, 50%"> . . . </frameset> </html> So how do you actually create the frames that should be displayed? Take a look at the next section. |