Section 12.5. Inline (Floating) Frames


12.5. Inline (Floating) Frames

Microsoft Internet Explorer 3.0 introduced a feature called inline frames (also called floating frames ) that are identified with the iframe element. They enable an HTML document to be embedded within another HTML document, viewed in a scrollable frame. An iframe is placed in the document flow as an inline element, much like an image.

iframe

 <iframe> ... </iframe> 

Attributes

Core (id, class, style, title)
frameborder="1|0"
height="number"
longdesc="URL"
marginheight="number"
marginwidth="number"
name="text"
scrolling="yes|no|auto"
src="URL"
width="number"

Deprecated attributes

align="top|middle|bottom|left|right"

Nonstandard attributes

hspace="number"
vspace="number"

The iframe element is part of the HTML 4.01 and XHTML 1.0 Transitional DTD. As such, it is also included in the Frameset DTD, but it is not a frameset-related element. It is supported by standards-compliant browsers. It is however deprecated, and the preferred strict alternative is to use the object element instead, its type attribute explicitly set to text/html, and its data attribute set to the URL of the external document. Inline frames do not work in Netscape 4, but that accounts for a less than .5% of users as of this writing.

The iframe element places an external HTML document on a web page in a scrolling window. The src attribute provides the URL of the external document. The width and height attributes provide the dimensions of the floating frame. Figure 12-10 shows the resulting inline frame specified in this markup example.

 <body bgcolor="black" text="white"> <h1>Inline (Floating) Frames</h1> <p><iframe src="/books/4/439/1/html/2/list.html" width="200" height="100" align="left"> Your browser does not support inline frames. Read the list <a href="list. html">here</a>.</iframe></p> <p>Consectetuer adipiscing elit. Sed eu nibh eget magna dictum egestas... </p> </body> 

Figure 12-10. Inline (floating) frame





Web Design in a Nutshell
Web Design in a Nutshell: A Desktop Quick Reference (In a Nutshell (OReilly))
ISBN: 0596009879
EAN: 2147483647
Year: 2006
Pages: 325

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