hspace (HTML attribute)

Spec
Depr. Version
Yes N/A

Syntax

hspace="surrounding horizontal space in pixels"

Description

When embed content is aligned left or right, text will flow around the image but with no space between it and the image. The hspace (and related vspace) attribute provides a bit of ‘breathing space’, but it will apply a space on both sides of the embed which is not entirely flexible, as shown in Figure 1.
Figure 1. Embedded image with hspace of 20 applied (note the space either side of the object) Embedded image  with hspace of 20 applied (note the space either side of the object)

Example

The hspace attribute set to "20" pixels around a left-aligned embed object:

<embed src="giant-grasshopper.jpg" hspace="20" align="left"></embed>

Value

A number representing the width of spacing either side of the embed content in pixels.

Compatibility

Although support for this attribute is good, it’s now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.

User-contributed notes

There are no comments yet.

Related Products