forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (50 loc) · 1.66 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: HTMLImageElement.hspace
slug: Web/API/HTMLImageElement/hspace
tags:
- API
- HTML
- HTML DOM
- HTMLImageElement
- Horizontal
- Image
- Layout
- Property
- Reference
- hspace
- img
- left
- margin
- right
- spacing
- Deprecated
browser-compat: api.HTMLImageElement.hspace
---
<p>{{APIRef("HTML DOM")}}{{deprecated_header}}</p>
<p>The
<em>obsolete</em> <code><strong>hspace</strong></code> 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.</p>
<p>This property reflects the {{Glossary("HTML")}} {{htmlattrxref("hspace", "img")}}
attribute.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js"><em>htmlImageElement</em>.hspace = <em>marginWidth</em>;
<em>marginWidth</em> = <em>htmlImageElement</em>.hspace;
</pre>
<h3 id="Value">Value</h3>
<p>An integer value specifying the width, in pixels, of the horizontal margin to apply to
the left and right sides of the image.</p>
<h2 id="Usage_notes">Usage notes</h2>
<p>The value specified for <code>hspace</code> is mapped to the {{cssxref("margin-left")}}
and {{cssxref("margin-right")}} properties to specify the width of those margins in
pixels.</p>
<div class="notecard warning">
<p><strong>Warning:</strong> This property is obsolete. You should instead use the CSS
{{cssxref("margin")}} property and its longhand forms to establish margins around
an <code><img></code>.</p>
</div>
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>