Mysterious Image Gaps in Gmail

There are always new and exciting sites online. Think you found one that is helpful? Share it with the group!

Moderator: Moderators

Mysterious Image Gaps in Gmail

Postby RaJesh Balakrishnan » Tue Jul 24, 2012 5:43 am

Have you noticed Gmail ruining your beautiful HTML emails? Are mysterious gaps appearing between your images? Well fear not, there’s an easy fix.

Recently, Google made a change to the way Gmail handles images in HTML-formatted emails. I’ll probably never know why they did this, but I’m sure there was a good reason. This doesn’t change the fact that it has caused problems for many people, like myself, that create and send emails. As a result of Google’s change to Gmail, any image in your email that is supposed to fit tightly against another image will now show a horizontal gap.

Firefox, Safari, Opera and Chrome users are the ones experiencing this mysterious gap or spacing. Don’t ask me how Internet Explorer managed to avoid this problem. Some of you may have dealt with a similar problem in Hotmail already. The fix for that was to add <style>img {display:block}</style> to the top of your HTML file.

While both Hotmail and Gmail have the same issue, you’ll need to do some extra work for Gmail since it ignores style definitions that are not “inline”. Like I said earlier, it’s quite easy to fix. You’ll just need to add style=”display:block” into the “img” tag for any images that you want to make sure have no gaps or spacing.

For example:

<img style=”display:block” src=”sample.gif” alt=”sample” />

Also, don’t forget to go back and check any email templates that you created and tested in the past but are still being sent to your subscribers. Even though they looked fine even last month, this change could wreak havoc on your design now.

Before
gmail01.jpg
gmail01.jpg (162.33 KiB) Viewed 3304 times


After using ”display:block”
gmail02.jpg
gmail02.jpg (158.4 KiB) Viewed 3304 times


Its a helpful Tips :)

Source: http://blog.icontact.com/blog/mysteriou ... -in-gmail/
RaJesh Balakrishnan
 
Posts: 104
Joined: Tue Nov 28, 2006 4:07 am
Location: India

Return to Online Ideas, Innovation & Cool Sites

Who is online

Users browsing this forum: No registered users and 4 guests