Idocs Guide to HTML

Attributes for <IMG ...>
HSPACE
VSPACE

HSPACE sets the horizontal space between the image and surrounding text. VSPACE sets the vertical space between the image and surrounding text.

HSPACE has the most pronounced effect when it is used in conjunction with ALIGN to right or left align the image. The following examples show HSPACE when it is not used, when it is set to 10, and when it is set to 50.

this code produces this
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  HSPACE=10 ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  HSPACE=50 ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

VSPACE sets the space on top and bottom of the image. The following examples show VSPACE when it is not used, when it is set to 10, and when it is set to 50.

this code produces this
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim audra minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  VSPACE=10 ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim audra minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
<IMG SRC="pumpkin.gif"
  ALT="picture of a pumpkin" 
  HEIGHT=100 WIDTH=100 
  VSPACE=50 ALIGN=LEFT>
picture of a pumpkin Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim audra minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.