Musheer Ali's Network
External CSS classes are not working in gmail
CSS classes are not working in gmail
When we are creating mails for newsletters,advertisements etc.. using external CSS style sheets and sending to any gmail id, Gamil will not take any css classes from external source , as a result our mail should not be in the perfect appearance.
Check the below html code of a simple mail..
Code:
Contents of style.css
.tablebody
{
background: url(images/img02.jpg) no-repeat left top;
border: 1px solid #E9E3CB;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
HTML code of mail
<link rel=”stylesheet” href=”http://www.example.com/css/style.css” type=”text/css” />
<table>
<tr>
<td>This is a test mail.
</td>
</tr>
</table>
If we are sending an html mail like above to a gmail id,when seeing in gmail is something different what we are expecting..
Gmail supports inline CSS. So when are sending to mails , use inline css instead of external css.
Code should be like this:
<table style=”background: url(images/img02.jpg) no-repeat left top;border: 1px solid #E9E3CB;font-family: Arial, Helvetica, sans-serif;font-size: 12px;”>
<tr>
<td>This is a test mail.
</td>
</tr>
</table>