The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My site uses some spacer gifs mainly to prevent Netscape from collapsing table cells. Now I know that you should always include Alt tags in images, but I find it very annoying when you randomly leave your mouse on the screen and the Alt window shows up and says "Spacer".

aspen...the problem with &nbsp; over a spacer gif is if your user resized their browser's font size, then guess what? Your tables break. Because even though invisible, a &nbsp; is still considered "text" so it has to obey the user. A spacer GIF stays the same size no matter what.

I'm glad someone brought this up. I don't use alt tags for spacers, and I have some other images that I can't figure a good an alt tag for - like some tiny colored squares that I use as dividers beween text links on one site. The text won't run together with or with out them and they look good..not ready to give them up, but they don't lend themselves to an alt tag. Of course, that means that my pages will never meet standards, even though they might be accessible in all browsers including text only, and set up so that they make sense with alternative software for disabled visitors.
Seems to me that a couple of years back the conventional wisdom was to include an alt tag whenever the image conveyed information of any kind. Now it's across the board, no matter what.

Originally posted by aspen I've never had to use a spacing gif in my life.

If I want netscape to render an empty cell I put an &nbsp; in it.

That's the best idea. using &nbsp; will save you quite a bit of load time. Using <img src="image.gif" width="1" height="1" alt="" border="0">
is 64 characters. Using &nbsp; is 6 characters. That's a 93% savings

Originally posted by creole Aidan...read my post from a few lines back...

Yup, I had read that. Spacer GIFs are good for spacing, but &amp;nbsp; is better for filling an empty cell. A lot of empty cells aren't for spacing anyway.

The other problem with using a '&nbsp' is if you want a cell to only be one or two pixels wide or high.

I usually critique site in the Web review forum who do not use alt tags, but this is an exception. The reason for alt tags is that users can use reading browsers and hear items like "XYZ Company" or whatever message the image is supposed to be conveying. Spacers are not meant to be seen or heard. It's a 'trick' used to deal with the shortcomings of Netscape 4. It will be moot point in a year.

Originally posted by TWTCommish
What, the word &quot;Spacer&quot; all over would be better looking? I wouldn't recommend ALT tags for blank spacer images - I honesly cannot think of a good reason to.[/B]

Of course not. Just read the post I made before the one you quoted, where I said that the proper way is to use:

Code:

<img src="image.gif" width="1" height="1" alt="" border="0">

You need reasons to use them? What about text-only browsers, text-to-speech browsers, following recommendations etc? There's few reasons for you.

Originally posted by TWTCommish
What, the word &amp;quot;Spacer&amp;quot; all over would be better looking? I wouldn't recommend ALT tags for blank spacer images - I honesly cannot think of a good reason to.

Of course not. Just read the post I made before the one you quoted, where I said that the proper way is to use:

You need reasons to use them? What about text-only browsers, text-to-speech browsers, following recommendations etc? There's few reasons for you. [/B]

How does alt="" help a text or reading browser? There is nothing there for it to read. Alt tags were designed to convey a message if the picture could not be seen. There is no image to be seen with a transparent spacer. Using an alt tag defeates the purpose.

Originally posted by westmich
How does alt=&quot;&quot; help a text or reading browser? There is nothing there for it to read. Alt tags were designed to convey a message if the picture could not be seen. There is no image to be seen with a transparent spacer. Using an alt tag defeates the purpose. [/B]

Precisely. However, a validator or text-to-speech browser won't pick the difference between a spacer and an image.

What if you used &nbsp while also setting the font size attribute so it could'nt be resized ? Or instead of & nbsp what about a "." with the font size fixed to say 1px. Should allow you to space all but the smallest cells with no problems wihtout the spacer.

There is nothing wrong with using spacer GIfs...sometimes it is the only way to get what you need. What if you want a 2 pixel tall line across the screen? A &nbsp; would not let you do that without devising some elaborate method to keep the size down. A spacer GIF is reliable and ALWAYS does what you want it to do.