Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS not works for anchor tag in Outlook mail

CSS applied to link in Outlook not works

HTML:

<tr>
<a href="http://www.google.com" style="color:#FFF;height:40px;width:475px;display:block;"><td style="background-color:#000;height:40px;width:475px;">Click Me</td></a>
</tr>

it only display link to "Click Me" text not to all

Note: It should display link to all td i.e. width:475 & height:40

Please help me

Thanks

like image 366
user2046091 Avatar asked Jun 18 '13 13:06

user2046091


People also ask

Do anchor links work in Outlook?

Some email clients don't support anchor links: Gmail (iOS), Apple Mail (iOS), Outlook.com (Web), Outlook (Android), Outlook (MacOS).

Can you use CSS in Outlook?

Outlook does not support CSS styles for widths and heights. If you don't include the width and height attributes, Outlook will display your image at its actual size. If you're using retina images (which you should be), this will lead to giant images that'll break your emails.

Do anchor tags work in email?

Anchor links are an outdated email marketing feature that don't work when viewing emails on a mobile device. In this Video Tutorial, you'll learn better ways to display a lot of information to your contacts instead of using anchor links in your emails.


2 Answers

You can use outlook specific HTML to fix this

<div><!--[if mso]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://" style="height:40px;v-text-anchor:middle;width:200px;" stroke="f" fillcolor="#556270">
<w:anchorlock/>
<center>
<![endif]-->
 <a href="http://stackoverflow.com" style="background-color:#556270;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;">Show me the button!</a>
<!--[if mso]>
</center>
</v:rect>
<![endif]--></div>

Also refer http://buttons.cm/ for creating 'bulletproof' email buttons :)

like image 60
Mohammad Shabaz Moosa Avatar answered Oct 01 '22 04:10

Mohammad Shabaz Moosa


Try

<tr>
  <td style="background-color:#000;height:40px;width:475px;">
     <a href="http://www.google.com" style="color:#FFF;height:40px;width:475px;display:block;">Click Me</a>
  </td>
</tr>
like image 38
DerFuchs10 Avatar answered Oct 01 '22 04:10

DerFuchs10