经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » HTML/CSS » CSS » 查看文章
前端写html邮件模板(兼容outlook)
来源:cnblogs  作者:YJJMH  时间:2021/4/6 9:33:49  对本文有异议

使用前端完成邮件模板注意事项(实测兼容outlook2016)

  1.  使用html5之前的元素,outlook不支持html5;如果使用html5,outlook客户端会提示在浏览器中打开;
  2. 使用table表格布局;
  3. 仅使用table、tr、td、div、span、img等基本元素
  4. 尽量使用行内样式(class属性是否可用未测试)
  5. 使用行内样式时,每个元素尽量都写出对应的样式,可能继承性不好(未测试,谨慎起见写上而已)
  6. 使用table嵌套布局时,如果在table上设置margin/padding - top/bottom,outlook客户端中会导致table下的每个单元格都含有margin/padding - top/bottom,应当在需要的td中写margin/padding - top/bottom
  7. 示例:
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2. <html xmlns="http://www.w3.org/1999/xhtml">
    3.  
    4. <head>
    5. <meta charset="UTF-8">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>docmount</title>
    8. </head>
    9.  
    10. <body>
    11. <table border="0" cellspacing="0" width="100%" cellpadding="0" style="background:#F8F8FB;font-size:14px; border-collapse: collapse">
    12. <tr>
    13. <td align='center' style="padding-top: 50px;">
    14. <table border="0" cellspacing="0" width="700" cellpadding="0" style="margin: 0 auto;background:white;box-shadow:0 0 3px 5px #888888;font-size:14px; border-collapse: collapse">
    15. <tr>
    16. <td>
    17. <table border="0" cellspacing="0" width="540" cellpadding="0" style="margin:80px; margin-top:0; margin-bottom: 0; background:white;font-size:14px; border-collapse: collapse">
    18. <tr>
    19. <td>
    20. <div style="font-size:14px;">内容</div>
    21. <div style="margin-top: 20px; font-size:14px;">内容</div>
    22. <div style="margin-top: 5px; padding-bottom: 100px; font-size:14px;">内容</div>
    23. </td>
    24. </tr>
    25. </table>
    26. </td>
    27. </tr>
    28. </table>
    29. </td>
    30. </tr>
    31. </table>
    32. </body>
    33.  
    34. </html>

     

原文链接:http://www.cnblogs.com/YJJMH/p/14595713.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号