W3Schools.com

Frame/IFrame marginWidth Property

Frame/IFrame Object Reference Frame/IFrame Object

Definition and Usage

The marginWidth property sets or returns the value of the marginwidth attribute in a frame/iframe element.

The marginwidth attribute specifies the left and right margins of an frame/iframe, in pixels.

Syntax

frameObject.marginWidth=pixels

or

iframeObject.marginWidth=pixels


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The marginWidth property is supported in all major browsers.


Example

Example

Return the value of the marginwidth attribute:

<html>
<body>

<iframe id="myframe" src="demo_iframe.htm" marginheight="50" marginwidth="50">
<p>Your browser does not support iframes.</p>
</iframe>
<br /><br />

<p>The value of the marginwidth attribute is:
<script type="text/javascript">
document.write(document.getElementById("myframe").marginWidth);
</script>
<p>

</body>
</html>

Try it yourself »


Frame/IFrame Object Reference Frame/IFrame Object
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE