user544079
user544079

Reputation: 16629

padding around hyperlinked images in email clients

I have a hyperlinked image and a paragraph as

<a href="#"><img src=""  align="right"/></a><p>Some text</p>

But this hyperlink is causing some padding on the paragraph in Outlook for the email.

Is there a work around?

Upvotes: 2

Views: 1837

Answers (3)

user544079
user544079

Reputation: 16629

It's get fixed by adding a separate table for the images

<table border="0" cellpadding="0" cellspacing="0" width="x">
   <tr>
     <td><p>Some text goes here</p></td>
     <td><img src="picture.jpg" /></td>
   </tr>
</table>

Upvotes: 0

Godwin
Godwin

Reputation: 9907

I've found that when Writing html emails, you have to abandon all notion of good practice. Use tables and assume that the client will not understand css or not understand old html tags:

<table width="100%" style="width: 100%;">
    <tr>
        <td width="100%" style="width: 100%;">
            <p>Some text</p>
        </td>
        <td align="right" style="text-align: right;">
            <a href="#"><img src="" /></a>
        </td>
    </tr>
</table>

​ I would recommend checking it in every browser and every client possible (hotmail, gmail ect in different browsers, thunderbird, outlook...)

Upvotes: 3

Jesse
Jesse

Reputation: 8393

Styling HTML emails is a somewhat annoying process. Outlook only makes it more complicated as Outlook can appear very different from your classical web based email providers (yahoo, hotmail, gmail, etc.)

That said have you tried applying an inline style to your hyperlink?

<a style="padding:0; margin:0;" href="#">......

Upvotes: 0

Related Questions