HTML iFrames




HTML iFrames

Last Updated Jul 25, 2015, 10:00:25 PM

The HTML Inline Frame Element (<iframe>) represents a nested browsing context, effectively embedding another HTML page into the current page

An iframe or inline frame is used to display external objects including other web pages within a web page.

Syntax Example
Try It Now

Definition and Usage

Content categories flow content, heading content, phrasing content
Permitted content Special
Tag omission None, both the starting and ending tag are mandatory
Permitted parent element Any elements that accepts embedded content
DOM Interface HTML Heading Element


HTML iframe as Link Target

An iframe can be used as a target for the hyperlinks. An iframe can be named using the name attribute. .


Try It Now

Width and Height of an iframe

The height and width attributes are used to specify the height and width of the iframe.


Try It Now

HTML iFrame allowfullscreen

This attribute can be set to true if the frame is allowed to place into full screen

Example
Try It Now

HTML frameborder -

HTML 4 only

The value 1 (the default) tells the browser to draw a border between this frame and every other frame. The value 0 tells the browser not to draw a border between this frame and other frames.

Example
Try It Now

Using iFrames in More Advanced Way
Attribute Description Extra Note Live Example
allowfullscreen This attribute can be set to true if the frame is allowed to be placed into full screen Try It Now
frameborder The frameborder attribute specifies whether or not to display a border around an <iframe>.

HTML 4 only

Try It Now
height Indicates the height of the frame Try It Now
marginheight The amount of space in pixels between the frame's content and its top and bottom margins.

HTML 4 only

Try It Now
scrolling Enable scrolling in iframes

HTML 4 only

Try It Now


Browser Support
Property
iframes (Yes) (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)


Sources and Credits

The source of the content has been referred and updated with Mozilla Foundation and w3C

Last Updated Jul 25, 2015, 10:00:25 PM