HTML and CSS Reference
The main advantage of inline frames is that is that you can position them anywhere on a
web page, just as you can other elements like images or Flash movies. You can incorpo-
rate content from another page or even another site into a page in a seamless way
through the use of inline frames. Inline frames, which are specified using the <iframe>
tag, are commonly the means by which “widgets” offered by popular websites are incor-
porated into other websites. For example, sites like Twitter and Facebook offer widgets
that you can incorporate into your own site that are implemented using inline frames.
Here's a brief run-through of how to create floating frames. First, you define them using
the <iframe> tag. Like images, these frames appear inline in the middle of the body of
an HTML document (hence the i for inline). The <iframe> tag supports attributes like
src , which contains the URL of the document to be displayed in the frame, and height
and width , which control the size of the frame.
Table 17.3 lists the attributes of the <iframe> element.
Specifies the width, in pixels, of the floating frame that will hold the
Specifies the height, in pixels, of the floating frame that will hold the
Specifies the URL of the HTML document to be displayed in the frame.
Specifies the name of the frame for the purpose of linking and
Indicates whether the frame should display a border. A value of 1
indicates the presence of a border, and a value of 0 indicates no
border should be displayed.
Specifies the margin size for the left and right sides of the frame in
Specifies the size of the top and bottom margins in pixels.
Indicates that the frame should not be resizable by the user (Internet
As with the <frame> tag, indicates whether the inline frame should
include scrollbars. (This attribute can take the values yes , no , or auto ;
the default is auto .)
Specifies the height of the margin (Internet Explorer extension).
Specifies the width of the margin (Internet Explorer extension).