ObsoleteThis feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
The obsolete vspace
property of the HTMLImageElement
interface specifies the number of pixels of empty space to leave empty on the top and bottom of the <img>
element when laying out the page.
Syntax
htmlImageElement.vspace = marginHeight; marginHeight = htmlImageElement.vspace;
Value
An integer value specifying the height, in pixels, of the vertical margin to apply to the top and bottom sides of the image.
Usage notes
The value specified for vspace
is mapped to the margin-top
and margin-bottom
properties to specify the height of those margins in pixels.
Important: This property is obsolete. You should instead use the CSS margin
property and its longhand forms to establish margins around an <img>
.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of 'HTMLImageElement.vspace' in that specification. | Living Standard | |
HTML 4.01 SpecificationThe definition of 'HTMLImageElement.vspace' in that specification. | Recommendation | The HTML 4.01 specification offers additional details. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
vspace
|
Chrome
Full support 1 |
Edge
Full support 12 |
Firefox
Full support Yes |
IE
? |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
HTMLImageElement.vspace by Mozilla Contributors is licensed under CC-BY-SA 2.5.