Copyright © tutorialspoint.com

HTML <iframe> tag



Advertisements

Function:

The HTML <iframe> tag is used to create an inline frame.

Difference between HTML and XHTML:

NONE

Example:

<iframe src ="/htm/index.htm" width="100%"></iframe>

This will produce following result:

Online Practice:

To Become more comfortable - Do Online Practice

Attributes:

AttributeValueDescription
alignleft
right
bottom
top
middle
Specifies how to align the iframe according to the surrounding text
frameborder0 or 1Specifies whether or not to display border around the frame.
heightpixels or %Specifies the height of the inline frame.
longdescURLA URL to a long description of the frame contents.
marginheightpixelsAllows you to specify the width of the space between the left and right of the frame's borders and the frame's content. The value is given in pixels. For example marginwidth="10".
marginwidthpixelsSpecifies the margin, in pixels, between the frame's contents and it's left and right margins.
nameframe nameName of the frame
scrollingyes
no
auto
Determines scrollbar action
srcURLLocation of the frame contents file
widthpixels or %Specifies the width of the inline frame.

Standard Attributes:

AttributeDescription
classDocument wide identifier
idDocument wide identifier
titleSpecifies a title to associate with the element.
styleHelps to include inline casecadubf style sheet.

Copyright © tutorialspoint.com