HTML img vspace Attribute
HTML <img> tag
Definition and Usage
The vspace attribute specifies a whitespace margin on the top and bottom of the
image.
Compatibility Notes
The vspace attribute of the img element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <img style="margin: 20px 0px"/>
In our CSS tutorial you can find more details about the
margin property.
Syntax
Syntax Example
Attribute Values
Value |
Description |
pixels |
Specifies the top and bottom whitespace margin of the
image in pixels. Note: You cannot set a different value for top and
bottom whitespace margin with this attribute. |
Browser Support

The attribute is deprecated, but still supported in all major browsers.
Example
Source |
Output |
<img src="demo_img.jpg"
alt="W3Schools example picture"
vspace="20" />
|
|
Try-It-Yourself Demos
img vspace attribute example
Specify the left and right margin of the image.
In CSS: image margin example
Specify the top and bottom margin of the image with CSS.
HTML <img> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|