HTML DOM marginWidth 属性

定義と使用方法

marginWidth 属性は、フレームの左側と右側のページの余白(ピクセル単位で指定)を設定または返します。

構文

iframeObject.marginWidth=pixels

以下の例では、iframeの左端と右端のページの余白を返します:

<html>
<body>
<iframe src="frame_a.htm" id="frame1" marginwidth="50"></iframe>
<br /><br />
<script type="text/javascript">
x=document.getElementById("frame1");
document.write("iframeの左側と右側の余白は:");
document.write(x.marginWidth);
</script>
</body>
</html>