Forum Moderators: open

Message Too Old, No Replies

Really bad HTML still exists

At least in spam

         

rjohara

4:18 am on Sep 6, 2005 (gmt 0)

10+ Year Member



The following snippit of code broke through in a piece of email spam I just got. I guess some code generators still produce this stuff, but it made me shudder:

<font face="Verdana" size="2"><span class="emphasis">How can I restore my account access?</span></font>

MatthewHSE

1:27 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Extremely bad HTML exists everywhere you look on the web. Although, in some places, the bad meets the good in unexpected ways. Believe it or not, I've actually seen <font> tags with "class" and "id" attributes, which seemed very ironic to me, not to mention a little oxymoron-ish

Matt Probert

1:29 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following snippit of code broke through in a piece of email spam I just got. I guess some code generators still produce this stuff, but it made me shudder:
<font face="Verdana" size="2"><span class="emphasis">How can I restore my account access?</span></font>

Standard Microsoft-generated HTML.

Matt

cuce

6:47 pm on Sep 6, 2005 (gmt 0)

10+ Year Member



even mozilla firebird uses the font tag when writing html for email.

alot of email clients(almost all) dont support css
and a good majority of them dont even support the style attribute.

I find it interesting that there's such a push to move out of the old way of doing things(font tags replaced with css etc) in the browser world, but as far as email clients are concerned, it seems to be almost completely ignored.

Trace

4:16 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



Web based emails, like Hotmail, will strip all css from an email to replace it with their own.

If you want your email to save it own look and feel, you must use the font tag.

jetboy

4:54 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



alot of email clients(almost all) dont support css
and a good majority of them dont even support the style attribute.

If you want your email to save it own look and feel, you must use the font tag.

Bull. I don't know about GMail, because it was launched after I did email client testing, but the only vaguely current client with any sort of market share that trashes CSS is Lotus Notes.

Inline styles are rock solid, and you can put a block of styles in if you're prepared to cheat a little. This stuff's a couple of years out of date now, but I'd be very surprised if things have gone backwards. The main reasons that companies aren't using CSS in their emails is lack of knowledge, lack of support from their email tools and this kind of wooly belief that it can't be done. All it'd need is someone like Amazon or eBay to make the switch and you'd soon see things changing:

. Put the style sheet inside comment tags in the <body> section of the email, thus ensuring Hotmail and BT webmail render the styles.

. Hotmail and Freeserve webmail likes to change your CSS to their default styles. Even if you've specified a font size for <p> tags, don't expect links to come out the same size unless you've also specified it for <A> tags. Put font, colour and size information in all declarations. Don't rely on inheritance

. Sections of HTML that are too long will be automatically wrapped by AOL and Freeserve. Avoid by using adding in line feeds every 80 characters or so. In PHP use the Wordwrap function

. Avoid using background images. They are not supported in BT Openworld webmail (or Lotus Notes). This holds true for any method of defining them, either with HTML or the various CSS methods (using inline, per document or external style sheets)

. A style sheet within the document will avoid the need to have an internet connection to view the content of the email as it was intented

. Styles that effect the <BODY> of the email are likely to be overridden by webmail clients. It is best to specify page margins within the HTML

. If a coloured page background is used, when replying to the email the user will be forced into using that coloured background with their client's default HTML text colour. This can result in black-on-black text. The best solution is to use a 100% width table to achieve the background. This will not affect replies

MatthewHSE

6:15 pm on Sep 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want your email to save it own look and feel, you must use the font tag.

I didn't used to believe that, but after seeing my newsletters in a few of the less well-known webmail clients (the kind anybody can install on their server to offer webmail to their users), I decided it was worth it to use <font> and HTML attributes instead of CSS for most formatting. I know this isn't the right way, but wrapping the whole newsletter in a single <font> tag seems to work well (provided one main font is all you need).

I'm mostly in agreement with what Jetboy said - his findings are essentially the same as mine for the most part - but there are just enough non-mainstream webmail clients out there that, in my opinion, CSS in e-mail isn't a viable option yet. I now only use it for non-vital purposes, such as link underlining.

jetboy

6:46 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



MatthewHSE,

I think the same argument could be used against using CSS in web pages. There are still many niche web browsers that don't support CSS - just look in Evolt's browser archive - but those of us who use CSS heavily based the decision on browser market share.

The good thing about webmail is that you can see what your readers are using in your server logs. If 99%+ are using Hotmail, Yahoo etc, then I think the decision's pretty clear cut. If your logs show similar percentages to mine, you *can* use CSS, but that doesn't mean you should.

To be honest, some of the big plusses of CSS - separating presentation and content, caching etc. - are irrelevant to email, and abandoning legacy tags just because you can isn't much of an argument. And finding someone who really cares whether their email passes W3C validation is finding someone with too much time on their hands. ;)