English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML object hspace attribute

The hspace attribute specifies the space on the left and right of the object.

 HTML <object> tag

Online Example

Left and right margins are 100 pixel object:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <object> hspace attribute - Basic Tutorial Website (oldtoolbag.com)/title>
</head>
<body>
<h4>Object without hspace:</h4>
<p><object width="150" height="150" data="bookmark.swf"></object> 
This is some text. This is some text. This is some text./p>
<h4>Object with hspace:</h4>
<p><object width="150" height="150" data="bookmark.swf" hspace="100"></object> 
This is some text. This is some text. This is some text./p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the hspace attribute.

Definition and Usage

HTML5 The <object> hspace attribute is not supported. Please use CSS instead.

In HTML 4.01 In the <object>, the hspace attribute is deprecated.

The hspace attribute specifies the space on the left and right of the object.

Compatibility Notes

In HTML 4.01 In the <object>, the hspace attribute is deprecated. Please use CSS instead.

CSS Syntax: <object style="margin: 0px 100px">

CSS Example: <object> with margin

In our CSS tutorial, you can find more about margin property. Details.

Syntax

<object hspace="pixels">

Attribute Value

ValueDescription
pixelsThe space on the left and right of the object, in pixels.
 HTML <object> tag