gpt4 book ai didi

css - HTML 电子邮件客户端边框删除

转载 作者:行者123 更新时间:2023-11-28 02:19:17 26 4
gpt4 key购买 nike

好的,所以我正在尝试创建一个简单的单列 html 电子邮件模板。

我遇到的问题是,当我将 html 代码粘贴到我的电子邮件客户端以发送测试消息时,我似乎无法摆脱消息周围的白边。

我已经将 body 的 css 设置为内联,当我在浏览器中测试时,这非常有效,没有白边或边距....

    <body style="margin: 0px; padding: 0px; background-color: #000000" bgcolor="#000000"> 

....但是当我将代码粘贴到邮件客户端(我默认使用 Mac Mail)来发送测试邮件时,我总是在邮件周围出现白边,并且无法弄清楚如何摆脱这个。

我查看了一封我收到的带有全宽背景颜色的 html 电子邮件,并试图弄清楚它的作用是什么,但我没有看到任何不同之处,所以我只是错过了一些真正简单的东西吗? ?

<html>

<head>

<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->

</head>

<body style="margin: 0px; padding: 0px;" bgcolor="000">

<table cellspacing="0" cellpadding="0" border="0" width="100%" class="wrapper" bgcolor="#999999" border-collapse="collapse">
<tr>
<td align="center">
<table width="100%" height="200" bgcolor="#ffffff;" class="respon_table" style="max-width: 650px; padding: 10px;">
<tr>
<td style="background-color: #ffffff;">Email content goes here....</td>
</tr>
</table>
</td>
</tr>
</table>

</body>
</html>

https://jsfiddle.net/q16jgdtr/

this is the white border, the grey doesn't go the edge on either side

最佳答案

您拼错了 bgcolor 属性。它应该是一个有效的颜色。
例如bgcolor="#ffffff;" 应该是 bgcolor="#ffffff" -- 没有分号。
bgcolor="000" 应该是 bgcolor="#000000"

https://jsfiddle.net/q16jgdtr/3/

https://www.w3.org/TR/html4/index/attributes.html

关于css - HTML 电子邮件客户端边框删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48309135/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com