HTML iframe example coding

An inline frame is used to embed another website page or document within the a current HTML page or document.

An frame is coded in the following manner:

<iframe src=”http://www.chameleonwebservices.co.uk”></iframe>

 

AttributeValueDescription & Notes
alignleft

right

top

middle

bottom

Specifies the alignment of an <iframe> according to surrounding elements

This is not supported in HTML5. Deprecated in HTML 4.01.

frameborder1

0

Specifies whether or not to display a border around an <iframe>

This is not supported in HTML5.

heightpixelsSpecifies the height of an <iframe>
longdescURLSpecifies a page that contains a long description of the content of an <iframe>

This is not supported in HTML5.

marginheightpixelsSpecifies the top and bottom margins of the content of an <iframe>

This is not supported in HTML5.

marginwidthpixelsSpecifies the left and right margins of the content of an <iframe>

Not supported in HTML5.

namenameSpecifies the name of an <iframe>
sandbox“”

allow-forms

allow-same-origin

allow-scripts

allow-top-navigation

Enables a set of extra restrictions for the content in the <iframe>
scrollingyes

no

auto

Specifies whether or not to display scrollbars in an <iframe>

This is not supported in HTML5.

seamlessseamlessSpecifies that the <iframe> should look like it is a part of the containing document
srcURLSpecifies the address of the document to embed in the <iframe>
srcdocHTML_codeSpecifies the HTML content of the page to show in the <iframe>
widthpixelsSpecifies the width of an <iframe>