Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hotmail adding p tags within email, creating unwanted spacing

I've created an email signature, using tables for layout as I've read this is the best approach. Everything looks great for internal emails sent via Outlook 2013 but annoyingly when viewing an email in Hotmail, a bunch of spacing has been injected per <tr>. Viewing the source reveals that the content within the <tr> is being wrapped in a <p> with a .ecxMsoNormal class specified.

The p tag is being set a bottom-margin of 1.35em, hence the spacing issue. I've tried to override the class but it looks like <style> tags are being stripped before Outlook 2013 sends the email or it's completely getting ignored server side.

Is there a way to remove this spacing? If not, what would be a suitable work around? Nothing I try (table layout, div layout, wrapping inner content in font/div tags, overriding styles) seems to get rids of these p tags.

Edit:

See image for more details.

like image 834
Pedder Avatar asked Nov 04 '13 14:11

Pedder


1 Answers

You should never use p tags when coding an HTML email because various email clients add their own style to paragraphs which can not be completely predicted or overwritten.

Instead, you should use span. To achieve a paragraph effect you can write a double break after each block.

An example of two paragraphs would be:

<span>Paragraph</span>
<br><br>
<span>Paragraph</span>
like image 176
davidcondrey Avatar answered Sep 26 '22 01:09

davidcondrey