Back to Content

HTMLImageElement: vspace property

files/en-us/web/api/htmlimageelement/vspace/index.md

latest826 B
Original Source

{{APIRef("HTML DOM")}}{{deprecated_header}}

The deprecated vspace property of the {{domxref("HTMLImageElement")}} interface specifies the number of pixels of empty space to leave empty on the top and bottom sides of the {{HTMLElement("img")}} element when laying out the page. It reflects the `` element's vspace content attribute.

You should instead use the CSS property {{cssxref("margin")}} or its longhand properties to establish margin space around an image.

Value

An integer value specifying the height, in pixels, of the vertical margin to apply to the top and bottom sides of the image.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{cssxref("margin")}}
  • {{domxref("HTMLImageElement.hspace")}}