The <iframe> element

Short for ‘Inline Frame’. A document embedded within the main web page. Usually used for displaying adverts from third-party websites.

Full list of attributes

All the usual HTML global attributes are available

allowfullscreen
Boolean attribute which must be enabled for JavaScript code in the <iframe> to switch to full-screen mode.
height
The height the enclosing frame should be made in CSS pixels or as a percentage.
name
A name that can be used in a target attribute for a link to load content into this frame.
sandbox
Prevents the browser from trusting the content, for example by not running scripts in it. Note that if the browser doesn't support the sandbox attribute, then this is unsafe, and there are other security issues with it as well.
seamless
Include the iframe in the parent document as if it was a part of that document.
src
The URI from which the nested page should be loaded.
srcdoc
The full HTML or XML content to be displayed in the iframe, instead of loading it from the URI given by the src attribute.
width
The width the enclosing frame should be made in CSS pixels or as a percentage.

Further information

The Web Design Academy Contact us

By form

By Phone

+44 (0)113 234 4611

By email

enquiries@thewebdesign.academy

By snail mail

Suite 3 15 South Parade Leeds LS1 5PQ United Kingdom