Image vspace 屬性

定義和用法
vspace 屬性設置或返回圖像的頂部和底部的空白。
space 和 vspace 屬性可與 align 一同使用,來設置圖像與周圍文本的距離。
語法
imageObject.vspace=pixels
流覽器支持
所有主要流覽器都支持 vspace 屬性
實例
實例
下麵的例子將設置圖像的 hspace 和 vspace 屬性:
<html>
<head>
<script>
function setSpace()
{
document.getElementById("compman").hspace="50";
document.getElementById("compman").vspace="50";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<p>Some text. Some text. Some text. Some text.</p>
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
</body>
</html>
<head>
<script>
function setSpace()
{
document.getElementById("compman").hspace="50";
document.getElementById("compman").vspace="50";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<p>Some text. Some text. Some text. Some text.</p>
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
</body>
</html>
