HTML <iframe> tagS2C Home   « HTML <iframe> tag

Definition

The <iframe> tag is used to define an inline window that holds another document.

Example


<iframe>This text rendered in browsers not supporting iframe</iframe>

Required Attributes

NONE

Optional Attributes

align - deprecated - Use CSS instead.

longdesc - no browser support.

name - deprecated in XHTML - Use the id attribute instead.

frameborder - specifies a border.


<!-- Valid values are 0 and 1 (default is 1 - border ON) -->
<iframe frameborder="0">non iframe text here</iframe>

height - specifies the height of the iframe.


<!-- Valid values are % or a pixel value -->
<iframe height="20%">non iframe text here</iframe>

marginheight - specifies the top and bottom margins of the iframe.


<!-- A pixel value -->
<iframe marginheight="30">non iframe text here</iframe>

marginwidth - specifies the left and right margins of the iframe.


<!-- A pixel value -->
<iframe marginwidth="30">non iframe text here</iframe>

scrolling - specifies whether a scrollbar is viewable in the iframe.


<!-- Valid values are yes, no and auto -->
<!-- yes (scrollbars are always shown) -->
<!-- no (scrollbars are never shown) -->
<!-- auto - default (scrollbars are shown if needed) -->
<iframe scrolling="yes">non iframe text here</iframe>

url - specifies the name of a URL to display in the iframe.


<iframe url="aURL">non iframe text here</iframe>

width - specifies the width of the iframe.


<!-- Valid values are % or a pixel value -->
<iframe width="20">non iframe text here</iframe>

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<iframe class="classname">non iframe text here</iframe>

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<iframe id="idname">non iframe text here</iframe>

style - specifies an inline style for the element allowing you to apply the style to the content.


<iframe style="color:red;text-align:left">non iframe text here</iframe>

title - specifies extra information about the content.


<iframe title="information about the content">non iframe text here</iframe>

Language Attributes

NONE

Event Attributes

NONE

go to home page Homepage go to top of page Top