YouTip LogoYouTip

Att Iframe Marginheight

## HTML ` ``` ### Modern CSS Alternative (Recommended) Because `marginheight` is deprecated in HTML5, you should use CSS to control spacing. To control the spacing **inside** the iframe, you should apply CSS styles directly to the body of the document loaded inside the iframe (`demo_iframe.htm`): ```css /* Inside the embedded document (demo_iframe.htm) */ body { margin-top: 50px; margin-bottom: 50px; } ``` If you want to control the spacing **outside** the iframe (the space between the iframe and other elements on your parent page), use CSS margins on the ` ``` --- ## Browser Support The `marginheight` attribute is supported by all major legacy and modern web browsers for backwards compatibility: * Google Chrome * Microsoft Edge / Internet Explorer * Mozilla Firefox * Safari * Opera However, to ensure your website complies with modern web standards (W3C) and passes HTML5 validation, you should transition to the CSS methods described above.
← Att Iframe MarginwidthAtt Iframe Longdesc β†’