Site icon DW Faisalabad

HTML <iframe> marginheight and marginwidth Attribute

Example

An <iframe> with a top and bottom margin of 50 pixels:

<iframe src=”demo_iframe.htm” marginheight=”50″ marginwidth=”50″>
</iframe>

Try it Yourself »


Definition and Usage

The <iframe> marginheight and marginwidth attribute is not supported in HTML5. Use CSS instead.

The marginheight and marginwidth attribute specifies the top and bottom margins  and left and right of the content of an <iframe> respectively, in pixels.


Browser Support

Attribute
marginheight
marginwidth
Yes Yes Yes Yes Yes

The marginheight attribute is deprecated, but still supported in all major browsers.


Syntax

<iframe marginheight=”pixels” marginwidth=”pixels“>

Attribute Values

Value Description
pixels Specifies the top, right, bottom and left margins of the content of an <iframe>
Exit mobile version