artalk是一个开源的评论组件。

根据自己修改以及网上收集,找到了几种好看的样式。

信封样式

代码:

  1. <head>
  2. <style>
  3. * {
  4. margin: 0;
  5. padding: 0;
  6. }
  7. img {
  8. -webkit-user-drag: none;
  9. }
  10. .tk-owo-emotion {
  11. width: 3em;
  12. height: auto;
  13. max-width: 300px;
  14. max-height: 300px;
  15. vertical-align: middle;
  16. }
  17. </style>
  18. </head>
  19. </body>
  20. <div style="border-radius:5px;font-size:13px;width:680px;margin:30px auto 0;max-width:100%">
  21. <div style="box-shadow:0 0 30px 0 rgb(219 216 214);border-radius:5px;width:630px;margin:auto;max-width:100%;margin-bottom:-30px">
  22. <div style="width:200px;height:40px;margin-top:-20px;margin-left:0;text-align:center;line-height:40px;text-decoration:none;color:#fff;background-color:#94a9b9;border-radius:5px 0">Hi, {{nick}} !</div>
  23. <div style="line-height:180%;padding:0 15px 12px;margin:30px auto;color:#555;font-size:12px;margin-bottom:0">
  24. <h2 style="border-bottom:1px solid #ddd;font-size:14px;font-weight:400;padding:13px 0 10px 8px">
  25. <span style="color:#de6561;font-weight:700">&gt;</span>&nbsp;您在 offernow.cn /&nbsp;<a style="text-decoration:none;color:#12addb" href="{{page_url}}" target="_blank">{{page_title}}</a>&nbsp;上的留言有人给你回复啦~</h2>
  26. <div style="padding:0 12px 0 12px;margin-top:18px">
  27. <div class="Messages_box">
  28. <p style="display:flex;justify-content:flex-end">您曾经的评论:</p>
  29. <div class="ax_post_box-comments-single Messages-author" style="display: flex;justify-content: flex-end;margin-bottom: 5px;margin-top: 7px;">
  30. <div class="ax_post_box-comment-avatar" style="width: auto;flex: none;order: 2">
  31. <img src="https://cravatar.cn/avatar/{{parent_comment.email_encrypted}}?d=monsterid&s=80" style="width: 40px;height: 40px;border-radius: 5px">
  32. </div>
  33. <div class="ax_post_box-comment-text" style="position: relative;margin-right: 10px">
  34. <span class="ax_post_box-comment-text-before" style="width: 0;height: 0;border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid;border-left-color:#f4f4f4;border-right:0;border-right-color:transparent;right: -7px;left: auto;top: 12px;position: absolute"></span>
  35. <div class="ax_post_box-comment-text-inner" style="background-color: #f1f3fa;padding: 10px;border-radius: 9px;margin-bottom: 3px">{{content}}</div>
  36. </div>
  37. </div>
  38. <p><strong>{{reply_nick}}</strong> 回复您:</p>
  39. <div class="ax_post_box-comments-single Messages-user" style="display: flex;margin-bottom: 5px;margin-top: 7px;">
  40. <div class="ax_post_box-comment-avatar" style="width: auto;flex: none">
  41. <img src="https://cravatar.cn/avatar/{{comment.email_encrypted}}?d=monsterid&s=80" style="width: 40px;height: 40px;border-radius: 5px">
  42. </div>
  43. <div class="ax_post_box-comment-text" style="position: relative;margin-left: 10px">
  44. <span class="ax_post_box-comment-text-before" style="width: 0;height: 0;border-top: 8px solid transparent;border-bottom: 8px solid transparent;border-right: 8px solid;border-right-color: #f4f4f4;left: -7px;right: auto;top: 12px;position: absolute"></span>
  45. <div class="ax_post_box-comment-text-inner" style="background-color: #f1f3fa;padding: 10px;border-radius: 9px;margin-bottom: 3px">{{reply_content}}</div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div style="text-align:center">
  52. <a style="text-decoration:none;color:#fff;background-color:#94a9b9;padding:5px 20px;border-radius:4px;position:absolute;margin-left:-35px;margin-top:10px" href="{{link_to_reply}}" target="_blank">查看</a>
  53. </div>
  54. </div>
  55. <div style="width:100%;height:105px;background-repeat:no-repeat;border-radius:5px 5px 0 0;background-image:url(https://vkceyugu.cdn.bspapp.com/VKCEYUGU-2fa930c8-feec-4942-ac88-ba3781377bb0/eab533f6-d947-407e-a79e-6de525abd099.png);background-size:cover;background-position:50% 50%;">
  56. </div>
  57. <div style="color:#8c8c8c;font-size:10px;width:100%;text-align:center;margin-top:20px">
  58. <p>本邮件为系统自动发送,请勿直接回复~</p>
  59. </div>
  60. <div style="color:#8c8c8c;font-size:10px;width:100%;text-align:center;margin-top: 5px;margin-bottom: 5px;">
  61. <p>Copyright © 2024 <a href="{{site_url}}" target="_blank" style="color: #0083ff; text-decoration: none">
  62. {{site_name}}
  63. </a></p>
  64. </div>
  65. </div>
  66. <body>

示例图:

artalk的几个邮件通知模板 - 图1

简洁样式

代码:

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>邮件通知</title>
  7. <style>
  8. body {
  9. font-family: Arial, sans-serif;
  10. background-color: #f4f4f4;
  11. margin: 0;
  12. padding: 0;
  13. }
  14. .container {
  15. width: 100%;
  16. max-width: 600px;
  17. margin: 30px auto;
  18. background-color: #ffffff;
  19. border-radius: 10px;
  20. box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  21. }
  22. .header {
  23. background-color: #007bff;
  24. color: #ffffff;
  25. padding: 20px;
  26. border-radius: 10px 10px 0 0;
  27. text-align: center;
  28. }
  29. .header h1 {
  30. margin: 0;
  31. font-size: 24px;
  32. }
  33. .content {
  34. padding: 20px;
  35. line-height: 1.6;
  36. }
  37. .content h2 {
  38. font-size: 18px;
  39. color: #333333;
  40. margin-top: 0;
  41. }
  42. .content p {
  43. font-size: 14px;
  44. color: #555555;
  45. }
  46. .content a {
  47. color: #007bff;
  48. text-decoration: none;
  49. }
  50. .comment {
  51. background-color: #f9f9f9;
  52. border-radius: 5px;
  53. padding: 15px;
  54. margin-bottom: 20px;
  55. }
  56. .comment img {
  57. width: 40px;
  58. height: 40px;
  59. border-radius: 50%;
  60. vertical-align: middle;
  61. margin-right: 10px;
  62. }
  63. .comment .author {
  64. font-weight: bold;
  65. color: #333333;
  66. }
  67. .comment .text {
  68. margin-top: 10px;
  69. color: #555555;
  70. }
  71. .footer {
  72. text-align: center;
  73. padding: 20px;
  74. background-color: #f4f4f4;
  75. border-radius: 0 0 10px 10px;
  76. font-size: 12px;
  77. color: #888888;
  78. }
  79. .footer a {
  80. color: #007bff;
  81. text-decoration: none;
  82. }
  83. </style>
  84. </head>
  85. <body>
  86. <div class="container">
  87. <div class="header">
  88. <h1>您有新的回复</h1>
  89. </div>
  90. <div class="content">
  91. <h2>Hi, {{nick}}!</h2>
  92. <p>您在 <a href="{{page_url}}" target="_blank">{{page_title}}</a> 上的留言有人回复了。</p>
  93. <div class="comment">
  94. <img src="https://cravatar.cn/avatar/{{parent_comment.email_encrypted}}?d=monsterid&s=80" alt="Avatar">
  95. <span class="author">您曾经的评论:</span>
  96. <div class="text">{{content}}</div>
  97. </div>
  98. <div class="comment">
  99. <img src="https://cravatar.cn/avatar/{{comment.email_encrypted}}?d=monsterid&s=80" alt="Avatar">
  100. <span class="author">{{reply_nick}} 回复您:</span>
  101. <div class="text">{{reply_content}}</div>
  102. </div>
  103. <p>点击 <a href="{{link_to_reply}}" target="_blank">这里</a> 查看回复。</p>
  104. </div>
  105. <div class="footer">
  106. <p>本邮件为系统自动发送,请勿直接回复。</p>
  107. <p>Copyright © 2024 <a href="{{site_url}}" target="_blank">{{site_name}}</a></p>
  108. </div>
  109. </div>
  110. </body>
  111. </html>

示例图:

artalk的几个邮件通知模板 - 图2