HTML DOM properti Gambar vSpace
Definisi dan Penggunaan
vSpace set properti atau mengembalikan atas kosong dan bawah gambar.
ruang dan vSpace atribut dapat digunakan dengan menyelaraskan, untuk mengatur jarak antara gambar dan teks sekitarnya.
tatabahasa
imageObject.vspace=pixels
Dukungan Browser
Semua browser utama mendukung atribut vSpace
contoh
contoh
Contoh berikut akan mengatur hspace dan vSpace atribut gambar:
<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>
Coba »
gambar Object