An iframe is used to embed another document into a website, this can be a youtube vide, 360 virtual tour or even another webpage.
The iframe is used in Internet Explorer, Mozilla, Opera, Chrome and Safari which means it can be used safely on your website.
The use of iframes can be done in many ways and there is no real right or wrong way to do this as the best way depends on the final output required. Also for example if you use WordPress you use plugins to enalbe short codes.
In HTML5 we have new attributes that we can use such as sandbox, seamless and srdoc which we will show you how to use later.
Basic iframe coding:-
|left, right, top, middle, bottom
|Note this is no longer supported in HTML5.
Specifies hoe the alignment of an <iframe> will be plcaed on the page.
|Note this is not supported in HTML5. This specifies whether or not to display a border around the
|Specifies the physical height of an <iframe>
|Note this is not supported in HTML5. Specifies that the page contains a long description of the
content of an <iframe>
|Note this is not supported in HTML5. Specifies the top and bottom margins for the content of an <iframe>
|Note this is not supported in HTML5. Specifies the left and right margins to be used around the <iframe>
|Specifies the name of the <iframe>
|“”, allow-forms, allow-same-origin, allow-scripts, allow-top-navigation
|Allows you to set extra restrictions for the content in the <iframe>
|yes, no, auto
|Note this is not supported in HTML5. Specifies whether to display scrollbars in an <iframe>
|Specifies that the <iframe> should merge in with the containing document. You do this using <iframe seamless>. This is only supported by Chrome and Safari.
|Specifies the URL of the document to embed in the <iframe>
|Specifies the HTML content of the page to show in the <iframe>
|number of pixels
|Specifies the width of the <iframe>