简体   繁体   English

在Outlook 2007/2010中图像被截断

[英]Images getting cut off in Outlook 2007/2010

Images lost the top row of pixels, but only in certain situations. 图片仅在某些情况下会丢失第一行像素。 Example markup: 标记示例:

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top" height="20">
            <div style="line-height:0;"><img src="http://path.to/image.png" alt="" height="20" width="25" /></div>
        </td>
    </tr>
</table>

I was under the impression that since <img> is an inline element, it should be contained inside a block level element. 我的印象是,由于<img>是内联元素,因此应将其包含在块级元素内。 That's why I wrapped my <img> in <div> . 这就是为什么我将<img>包裹在<div> But this caused a problem where the text under-hang caused my <div> to be too tall. 但这引起了一个问题,即文本下垂导致我的<div>太高。 So I set line-height to 0 as a workaround. 因此,我将line-height设置为0作为一种解决方法。

No matter what height or valign I set on the <td> or the <img> , the top of the image is still cut off. 无论我在<td><img>上设置了什么heightvalign ,图像的顶部仍被切除。 I found that removing the line-height was the answer. 我发现删除行高就是答案。 Why is this? 为什么是这样?

I will use display: block on my <img> tags in the future. 以后,我将在<img>标签上使用display:块。

<div> s get treated differently depending on the email client you're using. <div>的使用方式会有所不同,具体取决于您使用的电子邮件客户端。 The IE of email clients is AOL (but, who uses that anymore). 电子邮件客户端的IE是AOL(但现在已经使用了)。 I think chipcullen is right that you're over thinking it a bit. 我认为Chipcullen对您过分考虑是正确的。 Why put in more code than necessary. 为什么要输入多余的代码。 Give this a try (no line reaks within the TD): 尝试一下(TD内无线路干扰):

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td><img src="http://path.to/image.png" alt="" height="20" width="25"></td>
    </tr>
</table>

Or if you really must define heights: 或者,如果您确实必须定义高度:

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="20" style="height:20px;line-height:20px;"><img src="http://path.to/image.png" alt="" height="20" width="25"></td>
    </tr>
</table>

Hope that helps! 希望有帮助!

This occurs in Outlook when a very long image is inserted in a campaign. 在广告系列中插入非常长的图像时,会在Outlook中发生这种情况。 The limit for image length is approximately 1728px tall. 图片长度上限大约为1728px。 Outlook will clip the excess off the top of images taller than 1728px. Outlook会将多余的部分从高于1728px的图像的顶部剪掉。

If you cannot decrease the size of your image to under 1728px tall, the best alternative is to crop the image into separate images. 如果无法将图像尺寸减小到1728像素以下,最好的选择是将图像裁剪为单独的图像。 If using a drag and drop template, you can then add multiple Image blocks to the campaign to upload each part of the image. 如果使用拖放模板,则可以将多个图像块添加到活动中以上传图像的每个部分。 To ensure the images appear as one fluid image, navigate to the Settings tab for each Image block and select the Edge To Edge check box under Margins. 为确保图像显示为一幅流畅的图像,请导航至每个图像块的“设置”选项卡,然后选择“边距”下的“边缘到边缘”复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM