如何在Mailchimp模板中保留图像尺寸 [英] How to retain image dimensions in Mailchimp templates
问题描述
较少用户友好的设计编辑器,它使用宽/高css样式来显示图像大小是什么,所以它说(例如)350像素宽,高234像素,你可以上传一个更大的图像,它显示为350px宽(这将使用户认为是正确的)。但是它不包括html img width / height值,除非您手动指定它们,这意味着图像大小在Outlook中是错误的。
有没有人知道反正强制最少要自动包含在img元素中的html width变量?否则用户必须手动为每个图像手动设置相同的宽度/高度,如果他们忘记了它将无法在Outlook中正确显示
谢谢,
Dave
对于其他参考,我现在已经用mailchimp和 https:// www。 snip2code.com/Snippet/25348/HTML-Email-Template--max-width-hack-for- (下)和img的max-width / max-height css值修复了outlook中的问题:
<! - [if(gte mso 9)|(IE)]>
< center>
< table>
< tr>
< td width =600>
<![endif] - >
< div style =max-width:600px; margin:0 auto;>
< p>即使在不支持最大宽度CSS< / p>的Outlook上,此文本将居中并限制为600像素
< / div>
<! - [if mso]>
< / td>
< / tr>
< / table>
< / center>
<![endif] - >
I'm creating a template in Mailchimp to send out newsletters. The template contains a repeatable section with an image of a prefixed size. For some reason it strips the width="" and height="" values from the img element and only includes them if you manually set these within the image settings for each image. This means if a user uploads an image of a different size and doesn't manually enter the correct dimensions then in Outlook the image displays as full size.
To make it even less user friendly on the design editor it uses the width/height css styles to show what the image size is, so it says (for example) 350px wide by 234px tall and you can upload a much larger image and it shows it at 350px width (which would make a user think it was correct). However it does not include the html img width/height values unless you manually specify them which means the image size is wrong in Outlook.
Does anyone know of anyway to force at least the html width variable to be automatically included in the img element? Otherwise users have to manually set the same width/height for each image manually and if they forget then it will not display correctly in Outlook?
Thanks,
Dave
For others reference I have now spoken to mailchimp and using a combination of the code at https://www.snip2code.com/Snippet/25348/HTML-Email-Template--max-width-hack-for- (below) and max-width/max-height css values for the img fixes the problem in outlook:
<!--[if (gte mso 9)|(IE)]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
<p>This text will be centered and constrained to 600 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
这篇关于如何在Mailchimp模板中保留图像尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!