Image vspaceProperty

Image 对象参考手册Image Object

Definition and Usage

The vspace property sets or returns the whitespace at the top and bottom of an image.

The space and vspace properties can be used with align to set the distance between the image and the surrounding text.

Syntax

imageObject.vspace=pixels


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the vspace property.


Examples

Examples

The following example sets the hspace and vspace properties of an image:

<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>

Try it Yourself »


Image 对象参考手册Image Object Other Extensions