Easy Tutorial
❮ Att Th Height Att Img Longdesc ❯

HTML <img> vspace Attribute

HTML <img> Tag

Example

An image with 50 pixels of margin on the top and bottom:


Browser Support

All major browsers support the vspace attribute.


Definition and Usage

In HTML 4.01, the vspace attribute for <img> is deprecated.

The vspace attribute specifies the white space on the top and bottom of an image.


Compatibility Notes

In HTML 4.01, the vspace attribute for <img> is deprecated. Use CSS instead.

CSS syntax: <img style="margin: 50px 0px">

CSS Example: Image with Margin

In our CSS tutorial, you can find more details about the margin property.


Syntax

Attribute Values

Value Description
pixels The white space on the top and bottom of the image, in pixels.

❮ Att Th Height Att Img Longdesc ❯