For maximum compatibility, you should use both embedded CSS and the HTML background attribute, as some clients ignore one and not the other.
<td style="background-image:url('http://www.example.com/smile.gif'); background-repeat:no-repeat;" background="http://www.example.com/smile.gif">Some text</td>
Some notes:
- You must use an absolute URL for the src image
- The quotes around the URL in the inline background image style should be there (the opposite of the usual CSS recommendation, but some clients have problems if single quotes are not included.)
- Do not use CSS shorthand, again some clients will ignore it, although they will parse a long arm. In addition, some will set the background color to # 000000 unless you set the background color in the shortened version.
- Background images do not work at all in Outlook 2007 unless you are using some pretty excellent Microsoft corporate code. Unfortunately, this code does not stop it from repeating.
The best way to stop repeating is simply to make the image much larger than necessary so that it never repeats.
Dan blows
source share