Generating a spacer gif on the fly

Max M maxm at mxm.dk
Wed Oct 9 15:38:00 CEST 2002


David Brown wrote:
> "Max M" <maxm at mxm.dk> wrote in message

> 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).


I think I know the reasons, but I just wanted to hear your argument, as 
the other one was a bit brief ;-)

> 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 gets cached. I have never seen this to be an actual problem. It's 43 
bytes.

> it can make a real
> mess if the user has turned off image download,


Hmmm... then my pages would look a mess anyway...

> it makes a mess of the page
> if the user saves it as html for later reference,


That depends a lot on how the browser saves the page. And not really 
something I will take into account. If users decides to use dynamic 
content outside it's enviroment, that's their problem ;-)

> 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),

Spy dot's are not a problem on a webserver. Only in html mail, which I 
don't inted to use it for.

> 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).


These points has some validity but you can design around them.

The most important one is the disadvantaged user. For those I prefer to 
create a simpler view of the page anyway.

> 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.


A spacer works uniformly in any browser. I have never had a complaint 
when using them. Transparent spacers are the most common but not the 
only one needed.

A single pixel multi colored gif can be used for several purposes in 
layouts, like creating vertical lines:

<td align="center"><img src="<%= spacer('#844221')%>" width="2" 
height="100%"></td>

I have Art Directors demanding all sorts of unreasonable things all the 
time ;-)


regards Max M

 ><evolve>
   >    >




More information about the Python-list mailing list