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("Left and right margins of the iframe are: ");
document.write(x.marginWidth);
</script>
</body>
</html>