English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <iframe> marginheight attribute

This article introduces the HTML iframe marginheight attribute, which specifies the top and bottom blank space of the <iframe> content in pixels, and demonstrates how to use the HTML iframe marginheight attribute, browser compatibility, syntax definition, and detailed information about its attribute values through online examples.

 HTML <iframe> tag

Online Example

An <iframe> with top and bottom margins of30 pixels:

<iframe src="demo-iframe.html" marginheight="30"></iframe>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the marginheight attribute.

Definition and Usage

HTML5 The marginheight attribute of <iframe> is not supported. Please use CSS instead.

The marginheight attribute specifies the top and bottom blank margin of the <iframe> content in pixels.

Syntax

<iframe marginheight="pixels">

Attribute Value

ValueDescription
pixelsSpecify the top and bottom margin of the <iframe> content in pixels.
 HTML <iframe> tag