HTML-DOM Bild vspace Eigenschaft
Definition und Verwendung
vSpace-Eigenschaft legt oder es wird ein leeres oberen und unteren Rand des Bildes.
Raum und vspace Attribute können mit align verwendet werden, um den Abstand zwischen dem Bild und dem umgebenden Text zu setzen.
Grammatik
imageObject.vspace=pixels
Browser-Unterstützung
Alle gängigen Browser unterstützen vspace Attribut
Beispiele
Beispiele
Das folgende Beispiel soll die hspace und vspace Attribute eines Bildes festgelegt:
<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>
Versuchen »
Bildobjekt