所以我现在可以很容易地在我们要发送给公司的电子邮件上运行编码,其中包括我们的 Logo 、我们是新代理的新公司的图片,而且我还没有任何 Blurb为了公司,但它还是会来的
所以发生的事情是想给我的电子邮件添加一个小的背景变化,我们的 Logo 是白色的, body 的其余部分是深灰色的,但是一旦我在我的 body 中创建一个 div,它就会打破我的图片和文字出现
代码
<html>
<header>
<img src="https://gallery.mailchimp.com/2e2d72a3d233cacb63ee93d53/_compresseds/03bb5db7-9357-47d4-b8ab-a6f0ae575554.jpg" style="max-width:80%;height:auto;padding-left:9%;"/>
<style>
body {Color: ; background-color:white} div {background-color:#545454;padding-top:20px;padding-bottom:0.2px}
</style>
</header>
<body>
<br>
<h2 Style="Text-align:center;color:#A6ACAF;text-size:100%">We Are Now A</h2><h1 Style="text-align:center">LUK Agent <br><br>
<div>
<img src="https://gallery.mailchimp.com/2e2d72a3d233cacb63ee93d53/images/08ed7f7f-6417-4719-a3bc-3bf29a97bd1b.jpg" style="max-width:70%;height:auto;padding-left:0%;"/> <p Style="Text-align:Center;Border:5% solid #364C94;Align:Center;padding:5px;width:68.5%;margin-left:15%">Small Blurp of LUK</p>
</div>
在 w3schools 中运行它时它完美运行 如果有人可以将此编码添加到他们的 Mailchimp 中,就会明白我的意思,它会破坏代码和结构
最佳答案
这里有一些准则:
- 关闭所有不自闭的标签(img 标签是自闭的,但 body、html 和 h1 不是)。
- 不要在标题中放置 img 标签。那里是不允许的。将其移至正文。
- 不要使用空的 CSS 命令,例如“Color: ;”。
- 不要自己编写 CSS 命令,例如“对齐”;
- 用小写字母书写 CSS 命令和属性(不确定这是强制性的,但将它们大写是非常罕见的)。
- 为了清晰起见(HTML 结构)使用缩进。
这将导致以下代码:
<html>
<header>
<style>
body {color: black;background-color:white;}
div {background-color:#545454;padding-top:20px;padding-bottom:0.2px;}
</style>
</header>
<body>
<img src="https://gallery.mailchimp.com/2e2d72a3d233cacb63ee93d53/_compresseds/03bb5db7-9357-47d4-b8ab-a6f0ae575554.jpg" style="max-width:80%;height:auto;padding-left:9%;" />
<br>
<h2 style="text-align:center;color:#A6ACAF;text-size:100%">We Are Now A</h2>
<h1 style="text-align:center">LUK Agent</h1>
<br>
<br>
<div>
<img src="https://gallery.mailchimp.com/2e2d72a3d233cacb63ee93d53/images/08ed7f7f-6417-4719-a3bc-3bf29a97bd1b.jpg" style="max-width:70%;height:auto;padding-left:0%;" />
<p style="text-align:center;border:5% solid #364C94;padding:5px;width:68.5%;margin-left:15%;">
Small Blurp of LUK
</p>
</div>
</body>
</html>
关于html - 编码 mailchimp 电子邮件内联样式无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52605277/