Complete HTML Reference is fairly extensive. <iframe> is described rather meagerly here.
The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document withing the current HTML document.
A number of attributes is no longer supported in HTML5:
Attribute | Value | Description |
---|---|---|
height | pixel | Specifies the height of an <iframe> |
name | text | Specifies the name of an <iframe> |
sandbox | allow-forms
allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-top-navigation | Enables an extra set of restrictions for the content in an <iframe> |
src | HTML_code | Specifies the HTML content of the page to show in the <iframe> |
width | pixel | Specifies the width of an <iframe> |
The src 'https://www.w3schools.com/html/html_iframe.asp' refused display. However, my file,
'149B_Misc&div.html', displayed well. The surprise lies in seeing scrollbars. Scrollbars are necessary to see the whole page. The scrollbars are provided automatically.
Note: image style adjacent display did not work. I had to use <div>.
By default, an iframe has a border around it. To remove the border, add style = "border: none;".
With CSS, you can also change the size, style and color of the iframe's border:
Example
<iframe src = "demo_iframe.htm" style = "border:2px solid red;"></iframe> is in code format.
An iframe can be used as the target frame for a link.
The target attribute of the link must refer to the name attribute of the iframe:
Example:
<iframe src = "demo_iframe.htm" name = "iframe_a"></iframe>
<p><a href = "https://www.w3schools.com" target = "iframe_a">W3Schools.com</a></p>
www.w3schools.com refused to connect.
Although, the example uses html file for the iframe source, I tried to use song without controls and it works. Note the first iframe tag assigns a file to the iframe and assigns a name. The second <p> statement is a normal reference, but with the addition of a target, where the name of the target is the name given in the <iframe>line.
Video and audio content per Apr 10,2019
HTML Updated 04/30/19
After a period of 3 frustrating hours to get HTML5 video work I give up. It did not work either in Chrome of Firefox.
Many complained on the internet.
< Check out iframe >