to home page

BWRS
SEARCH

HOMETUTORIALSLINKSFORUMGLOSSARYNEWS
 

<spacer> tag

Spacer 

Netscape developed the <spacer>tag as useful aid to site design. Sadly its not been picked up by their rivals or the W3C HTML specs (except for WebTV !!!)

Essentially the <spacer> tag create an are of transparent space on a webpage. This can be useful in controlling tables.

Here is a set of 1 X1 table illustrating how you can create spacer of any size (sorry Internet explorer and some other browser users will see nothing)

width="5"
height="5"
width="10"
height="10"
width="55"
height="15"
width="25"
height="55"

 

The <spacer> tag doesn't need closure
(e.g. </spacer> is unnecessary)

to make it work you'll need to set the following attributes

type
The examples above are where type="block". You can use "vertical", which sets spacer between 2 lines of text, or "horizontal", which sets a spacer between characters on the same line

Width and height
Self explanatory. Set how big you want your space in pixels for Block spacers (only for block spacers)

Size
The equivalent to width and height for vertical and horizontal spacers

align
aligns the spacer with text as you do for <img> tags

Now, there are several solutions to replicate the effects of spacers

(1) hspace and vspace

You've seen this before but remember you can use this to control the space around an image

for example this pichas a hspace of 10 whilst this one has a hspace of 20

(2) The nonbreak space special character

        ( &nbsp; or &#160;)

You can use the special character for nonbreaking space to separate out text. Remember you can't have 2 spaces in a row on HTML text, well that's not strictly true

e.g.
<h4>I have used &nbsp;&nbsp;&nbsp;3 space
character in a row</h4>

would give

I have used    3 space characters in a row


(3) transparent .gif

This is perhaps the most useful of all. Remember you can warp the size of any image to fit any sized space. Well if you make a 1 x1 pixel that is completely transparent you can warp this to fit any sized space
width="5"
height="5"
width="10"
height="10"
width="55"
height="15"
width="25"
height="55"

 

This gives the same result and works on the vast bulk of browsers. We've created one which you candownload in a zip file (makes getting an invisible item easier)

Back to Browser Specific main
BACK TO BROWSER SPECIFIC MAIN