the space of an image


<img src="" vspace="" hspace="">

The vspace and hspace attributes of the IMG element adds white space around an image.


<img src="example.jpg" alt="Example" vspace="5" hspace="5">


Attribute Value Explanation
vspace=" " pixels vertical white space (the top and bottom sides)
hspace=" " pixels horizontal white space (the left and right sides)

The use of these attributes is deprecated. (Use CSS instead)

Tips and Notes

Use CSS instead of deprecated HTML. Please see the "Related Document" for details on CSS.


Example

vspace: 30px

<p>
<img src="image/example.jpg" alt="Example" align="left" vspace="30">
some text some text<br>some text some text<br>some text ...
</p>
Output

Example some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text


hspace: 30px

<p>
<img src="image/example.jpg" alt="Example" align="left" hspace="30">
some text some text<br>some text some text<br>some text ...
</p>
Output

Example some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text


vspace: 30px, hspace: 30px

<p>
<img src="image/example.jpg" alt="Example" align="left" vspace="30" hspace="30">
some text some text<br>some text some text<br>some text ...
</p>
Output

Example some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text