首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mac Mail中html签名中的图像大小无法固定

Mac Mail中html签名中的图像大小无法固定
EN

Stack Overflow用户
提问于 2020-03-28 19:10:34
回答 1查看 374关注 0票数 1

我找到了this post,它解释了如何在Mac Mail中创建一个好看的电子邮件签名。按照说明操作后,我设法找到了签名文件。我认为Mac Mail包含使用base64编码的同一文件中的图像。所以,一旦我用表格编辑了这个文件,Mac Mail上的一切看起来都很棒。然而,当我发送电子邮件时,我得到了巨大的图像,尽管我已经在表中指定了图像的widthheight属性。我不明白为什么邮件客户端( Mac mail和Mail for iOS)选择忽略图像的大小,所以我别无选择,只能缩小图像的大小,使它们以正确的像素数显示。当我在Mac Mail中打开签名时,它现在可以正常工作,但在iOS中它仍然显示非常糟糕:

我有一种感觉,我在html代码中犯了愚蠢的错误。有没有一种方法可以强制表格占据100%的宽度,而不管我在哪里打开它的设备,并且每一列都占据这个宽度的固定百分比?另外,是否可以在不更改签名外观的情况下使用高分辨率图像(较大的图像)?这是我拥有的代码,除了编码的图像:

代码语言:javascript
复制
Message-Id: <E7A4C1FD-32C3-4CC0-902B-CDF3A26F9804>
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\))
Content-Type: multipart/related;
    type="text/html";
    boundary="Apple-Mail=_BBC3233F-4323-4ACF-A4B4-7BB0ECFE542E"


--Apple-Mail=_BBC3233F-4323-4ACF-A4B4-7BB0ECFE542E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
    charset=utf-8


    <p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
        <table style="width: 650px" cellSpacing="0" cellPadding="10pt" border="0">
  <tbody>
  <tr>
    <td vAlign="middle" style="width:260px"><SPAN class=3D"Apple-string-attachment"><OBJECT height=3D45 width=3D255 =
type=3Dapplication/x-apple-msg-attachment =
data=3D"cid:part1.3D429B4D.FBA99AB0@dress-sinpalabras.com"></OBJECT></SPAN=
><span class=3D"Apple-tab-span" style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: pre; widows: auto; word-spacing: =
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;">    </span><span style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none; display: inline =
!important; float: none;"> </td>
    <td style="font-size: 10pt; font-family: Arial; width: 390px; padding-left: 20px; border-left: #000000 1px solid" vAlign="top">
    <strong style="font-size: 11pt">
    <span style="font-size: 11pt; color: #000000">JULIA BIRLING</span> | Founding Director</strong><br><br>
      <a href="http://dress-sinpalabras.com">www.dress-sinpalabras.com</a><br>
        <a href="mailto:jbirling@dress-sinpalabras.com">jbirling@dress-sinpalabras.com</a><br><br>
      <a href="https://www.facebook.com/dress.sinpalabras/"><SPAN =
class=3D"Apple-string-attachment"><OBJECT height=3D40 width=3D37 =
type=3Dapplication/x-apple-msg-attachment =
data=3D"cid:part4.1A5B7902.C522684D@dress-sinpalabras.com"></OBJECT></SPAN=
></a>&nbsp; 
      <a href="https://www.instagram.com/sinpalabras_dress/"> <SPAN class=3D"Apple-string-attachment"><OBJECT =
height=3D40 width=3D39 type=3Dapplication/x-apple-msg-attachment =
data=3D"cid:part6.A712535C.3060744F@dress-sinpalabras.com"></OBJECT></SPAN= >= </a></td></tr></tbody>
        </table>
    </p>


--Apple-Mail=_BBC3233F-4323-4ACF-A4B4-7BB0ECFE542E
Content-Transfer-Encoding: base64
Content-Disposition: inline;
    filename=it.png
Content-Type: image/png;
    name="it.png"
Content-Id: <part6.A712535C.3060744F@dress-sinpalabras.com>

... 
EN

回答 1

Stack Overflow用户

发布于 2021-11-03 15:45:31

在发送时,Mail.app将该<object>转换为<img>,并剥离其高度和宽度属性。

尝试添加<style>标签以防止图像大于其容器,如下所示:

代码语言:javascript
复制
<style><!-- img { max-width: 100%; } --></style>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60900361

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档