It is best practice to stick with HEX colors when designing HTML emails - does it matter?
+2
A:
If you are talking about color: #010203
vs color: rgb(1,2,3)
in CSS, it doesn't make any difference. But some HTML mail clients will not allow you to use arbitrary CSS anyway.
When colors are specified in the HTML itself (eg. <table bgcolor>
), only the #010203
format is allowed. Specifying colours in HTML is a vile horror that only really still exists because HTML mail is so fundamentally broken.
bobince
2010-09-22 10:58:49
+1
A:
Assuming you're referring to the declaration format rgb(x,y,z);
I believe that's a 2.1 feature and since browser support for that is incomplete *cough*IE*cough* I would recommend avoiding it for email clients which in general are considerably further behind the curve than browsers to put it mildly.
annakata
2010-09-22 11:03:55
`rgb()` is CSS1 and supported everywhere CSS is (though that may not include mail). Are you thinking of `rgba()` (with alpha channel) the CSS3 extension which IE doesn't support until IE9?
bobince
2010-09-22 14:28:48
Actually no, I was going by the quickref on webdevout - should have looked at the spec. Either way though, rgb is only partially supported on IE<8 an OP<9 and I wouldn't trust email clients for a second especially since realistically that means outlook. rgba is obviously right out :)
annakata
2010-09-22 14:55:29
`rgb()` is absolutely safe on all clients that support CSS. Webdevout is only complaining that browsers don't reject all possible invalid constructs, to which the simple answer would seem to be “don't write invalid CSS”...
bobince
2010-09-23 12:23:57
That's kind of missing the point - those browsers might be on the right side of liberal-accept, *but they still get it wrong*. If *they* get it wrong in a highly competitive and adaptive market an email has zero chance.
annakata
2010-09-23 14:37:00