10px spacer.gif win!

posted Thu, December 30, 2010 - 1:33 pm.

For the past year and a half my job requires that I do a lot of html that is going to be viewed in email clients. I would estimate that 75% of my work time is spent either designing or coding html email. So that means a lot of old-school, 90s table in a table in a table in a table and spacer gifs galore. While it isn’t as glamorous as my previous job I get to work at home and if I can say so myself I am a total fucking master of putting tables inside of tables inside of tables now.

Anyway, Outlook 2007/2010 has been my biggest headache (i’m leaving older versions of Lotus out of this since I highly doubt anybody that actually is forced to use it expects much from it) until yesterday. Yesterday, I made a giant leap forward in forever banishing those Outlook headaches.

Enter the 10px by 10px spacer.gif.

Numerous people on the web claim to be the inventor of this html hack so i’m not going to give credence to any of them, just to say they are out there and you can find them if you know how to work the Google. The other part of my personal fix was to be sure the preceding block of copy had a <br> tag after it but before my spacer.

In my case the spacers were mainly causing Outlook problems when they were used in place of paragraphs or line breaks between copy. See, the client likes things to be precise and “just like the design” so we sometimes revert to using spacers to match the design spacing. But Outlook 2007/2010 for whatever reason refuses to let you resize a spacer.gif if it is under 10px square.

Try it, it won’t work. Say you want a 1px spacer to be 200x10 and you end up with a spacer that is 66px wide. I can’t explain it. None of the fine people before me that found the glitch in the first place can explain it.

But use a 10px spacer and you can resize it to your heart’s content. Bigger, yup. Smaller, yup. It just works.

Just remember though if you’re using it to mimic paragraphs you need to use that <br> tag otherwise Outlook will try to put the image after the last word in the preceding paragraph. And no, display: block; doesn’t help, I guess Outlook also ignores that useful bit of HTML email code as well.

comments

be the first to comment.

you must be registered to post comments, register here

4 hours, 45 minutes
likes Christina by Steel Pole Bath Tub on Ping http://t.co/KHhR1zFh #iTunes
1 day, 1 hour, 29 minutes
from this point forward instead of saying that's so gay i'm going to say that's so raven.
3 days, 5 hours, 30 minutes
@chriswelle i call it all "the other music i like".
3 days, 6 hours, 7 minutes
@billburgess village green was a neighborhood of oddities yesterday. granted some were my extended family.
3 days, 6 hours, 9 minutes
@billburgess i won't even bring up the old guy on the super fast old guy scooter.
3 days, 6 hours, 15 minutes
@billburgess now if the little person that lives in village green would admit you were walking your dog yesterday. http://t.co/LyzHwpWZ
3 days, 6 hours, 30 minutes
@billburgess my wife has a pic of the fat guy on the little cycle (it was her brother) but i felt odd taking a photo of the midget. #true
3 days, 6 hours, 32 minutes
yesterday i saw a midget walking a big dog and a 300lb guy on one of those tiny tiny motorcycles. #trueButNoPhotographicProof
3 days, 6 hours, 33 minutes
you know what's good. real fuckin' good. avocado that's what. fucking avocados are damn good. #fuckingavocados
3 days, 6 hours, 41 minutes
hahahahahahahahaha. “@KristinaRosexxx: I feel like John Travolta and I have a lot in common.”
3 days, 7 hours, 35 minutes
bike to work week so i rode my bike to the end of my driveway and back. i want to be involved.
3 days, 11 hours, 12 minutes
http://t.co/utv3oMKg http://t.co/hJNvHWGh
6 days, 18 hours, 59 minutes
One of the best games ever. I am backing this. Carmageddon!!! http://t.co/wAHG9bdV
1 week, 3 days, 3 hours, 35 minutes
Book World in DL has great magazine selection and friendly staff. bought MRR & Resource. #thingstodoinDL
1 week, 3 days, 4 hours, 1 minute
buy used original stormtrooper action figure at The Toy Finder #thingstodoinDL
1 week, 3 days, 4 hours, 1 minute
have fresh maple long John from Blakey #thingstodoinDL
1 week, 3 days, 4 hours, 2 minutes
buy books at thrift store. #thingstodoinDL
1 week, 3 days, 6 hours, 46 minutes
nice MCA tributes. http://t.co/RrIch51P
1 week, 3 days, 9 hours, 3 minutes
I beat the minimum and now own The May Hurray Bundle http://t.co/VC1bNu7R via @indieroyale
1 week, 3 days, 9 hours, 4 minutes
@chriswelle what do you mean want?

follow me on twitter