Frame/IFrame marginHeight 属性
定义和用法
marginHeight 属性可设置或返回 frame/iframe 元素中 marginHeight 元素的值。
marginheight 属性框架的顶部和底部页空白(以像素为单位)。
语法
frameObject.marginHeight=pixels
或者
iframeObject.marginHeight=pixels
浏览器支持




所有主要浏览器都支持 marginHeight 属性
实例
返回 marginheight 属性的值:
<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 marginheight attribute is:
<script>
document.write(document.getElementById("myframe").marginHeight);
</script>
<p>
</body>
</html>