简体   繁体   English

样式化HTML电子邮件

[英]Styling HTML e-mail

When creating an HTML e-mail how do you specify the appearance, for example the font? 在创建HTML电子邮件时,如何指定外观,例如字体? Is there a better way than using inline CSS? 有没有比使用内联CSS更好的方法? I'm using cfmail to send e-mails. 我正在使用cfmail发送电子邮件。

You can style it in the <style> blocks in the head section, but the best/consistent way to style anything in HTML emails is by doing it inline unfortunately. 您可以在head部分的<style>块中设置<style> ,但是在HTML电子邮件中设置样式的最佳/一致方法是不幸地内联。 If you're feeling lazy you can use http://premailer.dialect.ca/ to move everything inline for you. 如果你感到懒惰,你可以使用http://premailer.dialect.ca/为你移动所有内联。

The most important aspect of html mails is making sure the recipient can read the mail. html邮件最重要的方面是确保收件人可以阅读邮件。 For this reason it is important to stick to basic HTML and than means inline CSS only i'm afraid. 因此,坚持使用基本的HTML非常重要,而不仅仅是内联CSS,我担心。

I use this tool - http://inlinestyler.torchboxapps.com/ 我用这个工具 - http://inlinestyler.torchboxapps.com/
Source files - https://github.com/davecranwell/inline-styler 源文件 - https://github.com/davecranwell/inline-styler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM