Generating a spacer gif on the fly

David Brown david at
Wed Oct 9 15:10:07 CEST 2002

"Max M" <maxm at> wrote in message
news:BtVo9.86824$Qk5.3914947 at
> Peter Maas wrote:
> > Max M schrieb:
> > Are you writing a web app? Then it would be better to use CSS
> > (position: absolute | relative) instead of old-fashioned spacer gifs.
> Why?

There are a number of reasons - you'll find more information by doing a
quick web search, or posting to web design newsgroups (since it is a web
issue rather than a python one).  But just to give a few reasons, it is much
slower and less efficient to use an image (which must be seperately
downloaded, even if it is small) than CSS positioning, it can make a real
mess if the user has turned off image download, it makes a mess of the page
if the user saves it as html for later reference, it may be wrongly taken
for a "spy dot" (I don't know if that's the correct term, but it describes
what I mean - an invisible gif, frequently sent in html email, used to pass
information back to a server when the user reads the page), it causes havoc
if the user is doing something you don't expect (such as using their own
preferred fonts, or magnifying the page, or using a text-only browser, or
using a reading program because their are blind or have poor vision).

And if all that doesn't turn you off, and you want to continue despite
everything you might read elsewhere against spacer gifs (which are an easy
solution, so despite their many disadvantages they may still make sense),
then use a single transparent gif so you don't need to worry about colour.

More information about the Python-list mailing list