View Full Version : CSS problem when integrating html into emails

Mar 20th, 2005, 11:24 AM
CSS problem, I have created an email template to send out to clients, which uses built in css. It works fine when sending to outlook express users but when sent to hotmail it does not load the css. (And looks very flat)

I would be gratefull if somebody could help me fix this problem if it is something wrong with my code (which it must be as I've seen other emails sent to hotmail where the css works.)

Here is the code which I then paste into the source function when composing an email in Outlook Express

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<style type="text/css">

a:link {color:#BDBDBE}
a:visited {color:#BDBDBE}
a:focus {color:#BDBDBE}
a:hover {color:#8FC6FC}
a:active {color:#BDBDBE}

body {background-color:#ebf5ff;}

hr {color:#FAD040;}

#title {
font: 16px "Verdana", "Arial", "Helvetica", "sans-serif";

div {
font: 10px "Verdana", "Arial", "Helvetica", "sans-serif";

#email {
font: 9px "Verdana", "Arial", "Helvetica", "sans-serif";
.savoir {
font: 18px "Arial Black", "Arial", "Helvetica", "sans-serif";
text-align: center;
.follow {
font: 12px "Arial Black", "Arial", "Helvetica", "sans-serif";
text-align: center;



<table width="100%" border="0" cellspacing="0" cellpadding="0">

<div id="email">
<p align="left">xxxxxxxxxxxxxx<br>
Website: <a href="xxxxxxxxxxxxxxxxxx" target="_blank">xxxxxxxxxxxxxxxxxxx
Email: &nbsp;&nbsp;&nbsp;&nbsp;<a href="xxxxxxxxxxxxxxxxxx">xxxxxxxxxxxxxxx</a><br></p>

<div class="savoir">
<div class="follow">

<div id="email">
<p align="right">Tel: xxxxxxxxxxxxxxxxxx<br>
Mobile: xxxxxxxxxxxxxxx<br>
Fax: xxxxxxxxxxxxxxx

<td colspan="3">
<hr noshade width="90%">

<td colspan="3">
<div id="title">
Title will go here if you have one
All your paragraphs of text will go here




Mar 20th, 2005, 04:51 PM
In general, and in my experience, when creating HTML emails, you;re going to run into problems with your CSS because mail applications react differently to style sheets, much like browsers do...The only difference between mail apps and browsers is that there are a zillion different common mail applications (as opposed to only a few common browsers), that are all programmed differently, and subsequently all render CSS slightly differently....And in some applications, CSS is not recognized at all...

When I do HTML emails, I try to stick to really basic HTML transitional code with minimal CSS...this means formatting HTML emails with tables instead of CSS positioning, and using <font> tags to accomplish a large portion of your text formatting...it's not pretty, but I've found that by formatting my emails this way, they are more likely to work and appear similarly in a wider range of mail applications...

And you should also definitely, definitely, definitely have a text-only version of your email that will load if the HTML formatting fails to load or is incapable of loading in certain mail apps....this way, the reader will at least see something ledgible, as opposed to nothing at all....

I would recommend a robust PHP application like PHPMailer for your emailing...it works well for me....Check it out HERE (http://phpmailer.sourceforge.net/)

good luck and hope this helps a little! :thumbsup:

Mar 20th, 2005, 06:08 PM
Yes thanks that is very helpfull. I will take that into account and am going to have to create a html versions.