HTML DOM marginHeight 属性

定义和用法

marginHeight 属性可设置或返回框架顶部和底部的页面空白(以像素计)。

语法

  1. iframeObject.marginHeight=pixels

实例

下面的例子可返回 iframe 顶部和底部的页面空白:

  1. <html>
  2. <body>
  3. <iframe src="frame_a.htm" id="frame1" marginheight="50"></iframe>
  4. <br />
  5.  
  6. <script type="text/javascript">
  7. x=document.getElementById("frame1");
  8. document.write("Top and bottom margins of the iframe are: ");
  9. document.write(x.marginHeight);
  10. </script>
  11.  
  12. </body>
  13. </html>