HTML <object> hspaceAttribute
Examples
An object with left and right margins of 100 pixels:
<p><object width="150" height="150" data="helloworld.swf" hspace="100"></object>
This is some text. This is some text. This is some text.</p>
This is some text. This is some text. This is some text.</p>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the hspace attribute.
Definition and Usage
HTML5 does not support the <object> hspace attribute. Use CSS instead.
In HTML 4.01, the hspace attribute of <object>is deprecated。
The hspace attribute specifies the whitespace on the left and right sides of an object.
Compatibility Notes
In HTML 4.01, the hspace attribute of <object> is deprecated. Use CSS instead.
CSS Syntax: <object style="margin: 0px 100px">
CSS Example: <object> with margins
In our CSS tutorial, you can find more aboutthe margin propertydetails.
Syntax
<object hspace="pixels">
Attribute Values
| Value | Description |
|---|---|
| pixels | Whitespace on the left and right sides of the object, in pixels. |
HTML <object> Tag Other Extensions