HTML DOM properti Gambar hspace
Definisi dan Penggunaan
hspace set properti atau mengembalikan gambar hspace nilai atribut.
Kosong tepi kiri dan kanan atribut hspace menentukan gambar.
tatabahasa
imageObject.hspace=pixels
Dukungan Browser
Semua browser utama mendukung properti hspace
contoh
contoh
Contoh berikut akan mengatur hspace dan vSpace atribut gambar:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi setSpace () {
document.getElementById ( "compman") hspace = "50" .;
document.getElementById ( "compman") vSpace = "50" .;
}
</ Script>
</ Kepala>
<Body>
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
<P> Beberapa teks. Beberapa teks. Beberapa teks. Beberapa teks. </ P>
<Input type = "button" onclick = "setSpace ()" value = "mengatur jarak horizontal dan vertikal">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi setSpace () {
document.getElementById ( "compman") hspace = "50" .;
document.getElementById ( "compman") vSpace = "50" .;
}
</ Script>
</ Kepala>
<Body>
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
<P> Beberapa teks. Beberapa teks. Beberapa teks. Beberapa teks. </ P>
<Input type = "button" onclick = "setSpace ()" value = "mengatur jarak horizontal dan vertikal">
</ Body>
</ Html>
Coba »
gambar Object