Can I use CSS in the HTML code for my campaign?
Print this Article
Comment on this Article
Last Updated:
September 3, 2008 5:30 PM
Because some email clients do not support CSS styles, you should not include CSS in your HTML code. To ensure your campaign message displays correctly, we recommend formatting your message using inline styles. For example:
<td style="color:#000000; font-weight:bold; line-height:1.5em; background-color:#FFFF99;"> This is text formatted using an inline style!</td>
In contrast, CSS styles display between the <style> tags in your code, and you apply the CSS style to parts of your page. For example:
<style>
.standardText{
color:#000000;
font-weight:bold;
line-height:1.5em;
background-color:#FFFF99;
}
</style>
<td class="standardText">This is text formatted using a style sheet!</td>
.standardText{
color:#000000;
font-weight:bold;
line-height:1.5em;
background-color:#FFFF99;
}
</style>
<td class="standardText">This is text formatted using a style sheet!</td>
Although both of these methods produce the same formatting results, the inline styles display accurately in most, if not all email clients. The CSS formatting may not display correctly in most email clients.