简体   繁体   English

电子邮件时事通讯未加载CSS

[英]Email newsletter not loading css

I have created a webpage to use as an email newsletter. 我创建了一个网页,用作电子邮件新闻稿。 I have used basic CSS and tables in the code. 我在代码中使用了基本的CSS和表格。 When I copy the content from the browser and paste it into the email compose page, the CSS is not being loaded. 当我从浏览器复制内容并将其粘贴到电子邮件撰写页面时,未加载CSS。

I read a couple of other articles about Gmail not supporting the <style> tag, but I tried Yahoo! 我读了其他几篇有关Gmail的文章,这些文章不支持<style>标记,但是我尝试使用Yahoo!。 and Lotus Notes and it still had the same issue. 和Lotus Notes,但仍然存在相同的问题。

How can I make this work for Gmail and other mail providers? 如何使此功能适用于Gmail和其他邮件提供商?

I have put in my code in a dropbox folder: https://dl.dropboxusercontent.com/u/29654441/email_newsletter/email_newsletter1.html 我已将代码放在保管箱文件夹中: https : //dl.dropboxusercontent.com/u/29654441/email_newsletter/email_newsletter1.html

Gmail and other Web Browser-based email clients do not support <style> tags in the head section of the document (or a <head> section at all, for that matter) as they conflict with their page's CSS. Gmail和其他基于Web浏览器的电子邮件客户端不支持<style>在文档的头部标记(或<head>部分可言,对于这个问题),因为他们与他们的页面的CSS冲突。 You will need to move/duplicate your CSS inline as well. 您还需要移动/复制内联CSS。

eg: 例如:

<head>
  <style>
    a { color: #ff0000; }
  </style>
</head>
<body>
  <a href="#"></a>
</body>

becomes... 变成...

<body>
  <a href="#" style="color:#ff0000;"></a>
</body>

Some online tools can aid you with this, but they only support basic CSS. 一些在线工具可以帮助您,但是它们仅支持基本CSS。 Chances are you'll need to do it manually, and remember to only style inline in the future. 您可能需要手动进行操作,并记住以后仅对内联进行样式设置。

Try http://premailer.dialect.ca/ or http://zurb.com/ink/inliner.php 尝试http://premailer.dialect.ca/http://zurb.com/ink/inliner.php

They don't support HTML email composing, they will show them when received but you will struggle to do it. 他们不支持HTML电子邮件撰写,它们会在收到时显示给您,但您会很难做到。 You could do it through an IMAP client that allows HTML composing, or you could sign up for a service such as MailChimp . 您可以通过允许HTML编写的IMAP客户端来执行此操作,也可以注册MailChimp等服务。

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

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