| I | |||
| Iframe Syntax | <iframe src="URL"></iframe> | ||
| <iframe src="demo_iframe.htm" height="200" width="300"></iframe> | Use the height and width attributes to specify the size of the iframe. | ||
| The attribute values are specified in pixels by default, but they can also be in percent (like "80%"). | |||
| Iframe - Remove the Border | <iframe src="demo_iframe.htm" style="border:none;"></iframe> | By default, an iframe has a border around it. | |
| To remove the border, add the style attribute and use the CSS border property | |||
| <iframe src="demo_iframe.htm" style="border:2px solid grey;"></iframe> | With CSS, you can also change the size, style and color of the iframe's border | ||
| iframe Attributes | |||
| align | left (Not supported in HTML5.) | ||
| right | |||
| top | |||
| middle | |||
| bottom | |||
| height | pixels | ||
| width | pixels | ||
| src | URL | ||
| srcdoc | HTML_code (HTML5. Specifies the HTML content of thepage to show in the <iframe> | ||
| scolling | yes (Not supported in HTML5.) | ||
| no (Specifies whether or not to display scrollbars in an <iframe> | |||
| auto | |||
| <iframe> supports the Global Attributes in HTML | |||
| <iframe> supports the Event Attributes in HTML | |||