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

3 days, 7 hours, 53 minutes
My Top 3 #lastfm Artists: Janice Whaley (32), The Kills (18) & New Order (12) http://t.co/MgAwDWKX
5 days, 6 hours, 16 minutes
@billburgess no no. i want to move from google. bye bye google. dreamhosts chipmunk mail or whatever it is called sucks though.
5 days, 6 hours, 17 minutes
@saboingaden gmail is the last google service i'm still using.
5 days, 6 hours, 20 minutes
ugh. looking for a replacement for gmail that will let me use my own domain. help!!!! been using dreamhost but it never works.
1 week, 2 days, 5 hours, 2 minutes
must have been serendipitous that i got my gas mask from amazon the day i decide to have massive and brutal gas problems.
2 weeks, 5 hours, 1 minute
@lunchyprices i know that feeling. #hideandseekwiththepizzabox
2 weeks, 9 hours, 26 minutes
@chriswelle yes!!!!
2 weeks, 9 hours, 43 minutes
tried watching 'the river' last night and nah, don't think i'll watch anymore of that.
2 weeks, 2 days, 21 hours, 12 minutes
My Top 3 #lastfm Artists: Foster The People (11), Wax Idols (7) & Magic City (6) http://t.co/MgAwDWKX
2 weeks, 5 days, 9 hours
@jhummel @brianpattison @chriswelle but you don't even look at porn, so uh, you're totally using it wrong.
2 weeks, 5 days, 9 hours, 2 minutes
@brianpattison @jhummel agreed. hummel is a UI snob.
2 weeks, 5 days, 11 hours, 14 minutes
yeah. i totally didn't think of using http://t.co/WR9hvD2T you are a genius.
2 weeks, 6 days, 4 hours, 5 minutes
@zacechola and reveal the location of my bunker!?!?
2 weeks, 6 days, 4 hours, 15 minutes
@zacechola that would mean i'd have to leave my house.
2 weeks, 6 days, 4 hours, 25 minutes
@zacechola also, this was the first i heard of TEDxFargo. of course i am a hermit.
2 weeks, 6 days, 4 hours, 25 minutes
@zacechola uh agreed… 'cept i graduated H.S. with one of the speakers. don't think that means i'm obligated to go though. does it?
2 weeks, 6 days, 4 hours, 45 minutes
dropped Bing (after dropping Google), using DuckDuckGo now. http://t.co/DxYGzRW7 via @gruber via this weeks The Talk Show
2 weeks, 6 days, 6 hours, 1 minute
i don't think my isfargoflooding.com site will get much traffic this spring. there goes my new pair of shoes.
2 weeks, 6 days, 6 hours, 26 minutes
looking for source of some old barn/farm building/etc wood. not a lot. enough for small project. willing to pay $$ if necessary. FM area.
2 weeks, 6 days, 6 hours, 50 minutes
@chriswelle @dustinrue i think it's kind of nice out today.

follow me on twitter