Image vspaceプロパティ
Image オブジェクト
定義と使い方
vspace プロパティは、画像の上部と下部の空白を設定または返します。
hspace と 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.html" 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.html" alt="Computerman">
<p>Some text. Some text. Some text. Some text.</p>
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
</body>
</html>
試してみる »
Image オブジェクト その他の拡張