Quick fix for Gmail image issue

I am sure like me most of you are facing problem in viewing your promotional newsletters and emailers in Gmail for some time. Even in yahoo mail you may experience the same problem.

images in Gmail before fix

Due to addition of margin around the images, the html gets distorted. Incidentally the solution to fix this issue is very simple. Just add ‘display: block;‘ in image’s inline style.

Example:
<img src="image_name.jpg" border="0: style="display: block;" />

For the safer side you can add ‘margin: 0pt; padding: 0pt;‘ along with the display.

Example:
<img src="image_name.jpg" border="0" style="margin: 0pt; padding: 0pt;  display: block;" />

I have done the cross browser testing and find working smoothly for me. Hope it will work for all.

Advertisement

10 Responses to “Quick fix for Gmail image issue”

  1. Shobhna Says:

    Ahhaa!! u made my job easy!!

  2. Audrey Says:

    Thanks for this – very helpful!!

  3. ritwick Says:

    What about multiple layout images in a tableless structure? Can you suggest anything?

    The code is as:

    mysite.com

    body
    {
    background : #000;
    }

    <code><a href="http://www.mysite .com" rel="nofollow"><b>mysite.com</b></a></code>

    <a href="http://www.mysite .com/invite/invite.html" rel="nofollow">Can’t see the email properly? Click here.</a>

     

    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>
    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>
    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>

    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>
    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>
    <a href="http://www.mysite.com&quot; title="mysite.com" rel="nofollow"></a>

    </code>

    • Vipul Mathur Says:

      @Ritwick – Your question is not very much clear and even code you have provided is not explaining the same.

      The ‘Quick Fix’ method is to keep all the images together in a emailer in a email client such as Gmail. If you have to use the ‘style’ with every ‘img’ tag. It is for both table or table-less layout.

      Let me know your issue in detail so that I can help with specific solution.

      regards
      -Vipul.

  4. Richard Says:

    Been looking everywhere, tried all fixes, display block, margin 0 ect….still not working for me…very frustrating..

    please help with alterante to your exampl, not sure what is goin on

  5. suraj Says:

    Thanks. this worked like a charm.. Made by day

    Thanks a TON !!!

  6. Andrew Says:

    Also if you want to get rid of the Gmail image issue, you can add style=”font-size:0px” to the tag where image is inserted.

    But this solution causes unreadable alt tag


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.