【问题标题】:how to send responsive email with ckeditor如何使用 ckeditor 发送响应式电子邮件
【发布时间】:2018-03-17 22:00:49
【问题描述】:

我正在使用 ckeditor 从网络服务器发送电子邮件。 但是我怎样才能使电子邮件的内容响应? 据我所知,我尝试的所有“响应式电子邮件”模板都以:

<center>
   <table style="width: 100%">
      <tr>
         <td>
         Some content goes here...
         </td>
      </tr>
    </table>
</center>

我需要使用这样的媒体查询吗?

@media (max-width: 450px) {
   table {
    max-width: 360px;
   }
}

如果是这样:我必须将它们放在 ckeditor 的 textarea 哪里才能与电子邮件一起发送?

【问题讨论】:

    标签: html ckeditor media-queries responsive


    【解决方案1】:

    如果点击工具栏中的按钮查看源码,可以在页面顶部添加样式标签。

    CKEditor 还允许您添加内联 CSS。

    但是,要使这两个功能正常工作,您需要在 ckeditor 的 config.js 文件中启用 allowedContent。

     config.allowedContent = true;
    

    您也可以在启动 CKEditor 时启用 allowedContent

    <script>
            CKEDITOR.replace( 'text-area-id' );
            CKEDITOR.config.allowedContent = true;
    </script>
    

    这是文档:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-04
      • 1970-01-01
      • 2014-05-15
      • 2018-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多