YouTip LogoYouTip

Att Iframe Marginwidth

# HTML ``` ### Modern CSS Alternative (Recommended) Because `marginwidth` is deprecated in HTML5, you should achieve the same layout effect using CSS. To control the spacing of the content inside the iframe, you should apply padding or margins directly to the body of the document loaded **inside** the iframe (e.g., `demo_iframe.htm`): ```css /* Apply this CSS inside the document loaded by the iframe (demo_iframe.htm) */ body { padding-left: 50px; padding-right: 50px; } ``` If you do not have control over the source document inside the iframe, you can wrap the `
``` --- ## Browser Support The `marginwidth` attribute is supported by all major legacy and modern desktop browsers for backwards compatibility: * Google Chrome * Microsoft Edge / Internet Explorer * Mozilla Firefox * Opera * Safari However, relying on this attribute is highly discouraged as modern browsers may phase out support for deprecated HTML4 attributes in future releases. Always opt for CSS-based layouts.
← Att Iframe NameAtt Iframe Marginheight β†’