开发者

Class not loaded

I have an CSS style in an external file and the element refers to a the style开发者_运维技巧 using the 'class' attribute.

However, I can't seem to get the styling.


Email is notorious for being difficult to style in multiple clients.

For this reason, inline styles and tables are the norm for email templates.

As for loading an external asset, a lot of email clients won't do this for privacy reasons, to prevent the sender from determining if the email has been read by attaching a unique identifier to the URL.

Example

http://example.com/assets/style.css?nonce=ac77f909

The system then checks the nonce against who it maps to, and can tell who is receiving/reading the email.

This is very useful for spammers.


No, most mail clients do not allow external stylesheets. Essentially, your HTML page is stripped of everything but the body content. Inline styles will work however.

References and tips:

  • http://blog.mailchimp.com/background-images-and-css-in-html-email/
  • http://groundwire.org/support/articles/css-and-email-newsletters


Many clients refuse to load external CSS and scripts. Among other things, they'd allow you to track users opening e-mails, which'd be a privacy issue.

Campaign Monitor has a great, comprehensive set of resources and templates for designing for e-mail clients.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜