Hacker News new | ask | show | jobs
by e0 4322 days ago
Why is it better to use inline CSS here? Isn't inline CSS usually frowned-upon?
4 comments

> Isn't inline CSS usually frowned-upon?

Yes, but not in the 1990s, which is the era HTML email finds itself stuck in.

Email clients strip external css and often the style tag. Therefore you have to use inline css to style html emails.
Most browser-based email clients (Gmail, Yahoo, etc.) strip out the head and body tags from HTML emails. You never really know what's going to be removed, so the safest thing is to inline all of your styles.
Yes. But generally when things are frowned-upon, it's because they have something going for them. (If everyone agrees that something is dumb, there's no point in belaboring it.) Inlining is the simplest and most fool-proof way to apply CSS, which helps explain why it works in email where all else fails.