tadam logo

<iframe>

HTML <iframe> Tag

Example

An inline frame is marked up as follows:
<iframe src ="/en/" width="100%" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
The output of the code above will be:

Definition and Usage

The <iframe> tag defines an inline frame that contains another document.

Browser Support

The <iframe> tag is supported in all major browsers

Differences Between HTML and XHTML

NONE

Tips and Notes

Tip: To deal with browsers that do not understand iframes, place the text you want between the opening <iframe> tag and the closing </iframe> tag.

Optional Attributes

DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
AttributeValueDescriptionDTD
alignleft
right
top
middle
bottom
Deprecated. Use styles instead.
Specifies the alignment of an iframe according to surrounding elements
TF
frameborder1
0
Specifies whether or not to display a border around an iframeTF
heightpixels
%
Specifies the height of an iframeTF
longdescURLSpecifies a page that contains a long description of the content of an iframeTF
marginheightpixelsSpecifies the top and bottom margins of an iframeTF
marginwidthpixelsSpecifies the left and right margins of an iframeTF
namenameSpecifies the name of an iframeTF
scrollingyes
no
auto
Specifies whether or not to display scrollbars in an iframeTF
srcURLSpecifies the URL of the document to show in an iframeTF
widthpixels
%
Specifies the width of an iframeTF

Standard Attributes

Тег <iframe> поддерживает следующие стандартные атрибуты:
AttributeValueDescriptionDTD
classclassnameSpecifies a classname for an elementSTF
ididSpecifies a unique id for an elementSTF
stylestyle_definitionSpecifies an inline style for an elementSTF
titletextSpecifies extra information about an elementSTF
More information about Standard Attributes.

Event Attributes

The <iframe> tag does not support any event attributes.

More information about Event Attributes.

Was this information helpful?
   

Comments