Skip to: content, navigation

by Ian Lloyd

vspace (HTML attribute)

Spec
Depr. Version
Yes HTML 4
vspace="surrounding horizontal space in pixels"

Example

The vspace attribute set to "30" pixels around a left-aligned image object:

<object data="giant-dog.jpg" height="225" width="300" align="left"
vspace="30"></object>

Description

The vspace attribute is similar to the hspace and provides a bit of ‘breathing space’ above and below an object, although it is not exactly a precision design tool, as Figure 1 shows.
Figure 1. Image object with vspace of 30 applied (note the space above and below image) Image bject with vspace of 30 applied (note the space above and below image)

Value

A number representing the amount of spacing above and below the image 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.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters