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

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

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)

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