大家好,我希望你能帮我解决一个问题...我看了一些例子,我编辑了它,以便能够制作电子邮件的正文,并能够通过Gmail和其他电子邮件提供商发送它...我在Tryit Editor中尝试过它并且效果很好:
https://www.w3schools.com/code/tryit.asp?filename=FSKBT3UW23J3
但最终到底是什么:
Featured
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Social Media
Legal
Terms & Privacy
Contact Information
Tell: 506 8888-8888
Email: [email protected] Web: www.dominio.com
我没有采取捕获,因为只有没有风格的文本,因为我已经放入框中,我希望你能澄清我做错了,我会非常感激。
大多数电子邮件客户端都会从电子邮件中删除头标记,因此引导程序和fontawesome链接标记以及头部中的样式标记可能都被删除,而电子邮件只包含来自body标记内部html的裸内容。此外,大多数电子邮件客户端都会阻止javascript,因此html正文底部的脚本标记可能也没有任何效果。编码html电子邮件以便在各种电子邮件客户端中进行一致显示非常棘手 - 请查看Common HTML Mistakes - Mailchimp以获取一些一般性指导。
您最好的选择是在没有任何JavaScript的情况下对电子邮件进行编码,并将您的样式内嵌在html或html正文中的样式标记内,而不依赖于外部样式表。一个基本的html电子邮件结构示例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Email Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<!-- put your email content in an html table and use inline styles -->
<table></table>
<!--
you can also use css in a style tag inside the body
but some clients may not handle this as well as inline styles
-->
<style type="text/css"></style>
</body>
</html>