HTML DOM Image hspace property
Definition and Usage
hspace property sets or returns the picture hspace attribute values.
Blank left and right edges of the hspace attribute specifies the image.
grammar
imageObject.hspace=pixels
Browser Support
All major browsers support hspace property
Examples
Examples
The following example will set the hspace and vspace attributes of an image:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function setSpace () {
document.getElementById ( "compman") hspace = "50".;
document.getElementById ( "compman") vspace = "50".;
}
</ Script>
</ Head>
<Body>
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
<P> Some text. Some text. Some text. Some text. </ P>
<Input type = "button" onclick = "setSpace ()" value = "set the horizontal and vertical spacing">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function setSpace () {
document.getElementById ( "compman") hspace = "50".;
document.getElementById ( "compman") vspace = "50".;
}
</ Script>
</ Head>
<Body>
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
<P> Some text. Some text. Some text. Some text. </ P>
<Input type = "button" onclick = "setSpace ()" value = "set the horizontal and vertical spacing">
</ Body>
</ Html>
try it"
Image Object