HTMLImageElement: hspace property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("HTML DOM")}}

The _deprecated_ **hspace** property of the {{domxref("HTMLImageElement")}} interface specifies the number of pixels of empty space to leave empty on the left and right sides of the {{HTMLElement("img")}} element when laying out the page. It reflects the <img> element's [hspace](/en-US/docs/Web/HTML/Reference/Elements/img#hspace) 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 width, in pixels, of the horizontal margin to apply to the left and right sides of the image.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

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