业余爱好者在编码时尤其如此,特别是涉及到电子邮件模板时。我很难让G-mail真正隐藏和正确显示内容。我在这里搜索并找到了一些我认为会有所帮助的答案,但它似乎不适合我的代码。截至目前,转发时不担心代码。用于隐藏和显示图像和文本的电子邮件模板
这里是具体的图像的代码部分。会爱上它的一些眼睛,也有一些帮助。一切都在一张桌子上,并且在普通浏览器中运行正常......只是专门在G-mail中寻求帮助。
CSS:
@media only screen and (min-width: 480px) {
.mobilechart {
display: none !important;
}
}
@media only screen and (max-width: 480px) {
.desktopchart {
display: none !important;
}
HTML:
<tr>
<td style="background-repeat:no-repeat;background-position:right;" >
<div class="desktopchart">
<img src="https://cdn.maropost.com/pro/uploads/account_415/77640/TC-Email_Template_DESKTOPCHART.jpg" style="width:100%;margin-top:auto;margin-bottom:auto;margin-right:auto;margin-left:auto;" >
</div>
<div class="mobilechart">
<img src="https://cdn.maropost.com/pro/uploads/account_415/77641/TC-Email_Template_MOBILECHART.jpg" style="width:100%;margin-top:auto;margin-bottom:auto;margin-right:auto;margin-left:auto;" >
</div>
</td>
</tr>
可能重复的[通讯不能隐藏敏感内容在Gmail上,当我尝试转发电子邮件](http://stackoverflow.com/questions/37182935/newsletter-cant-hide-responsive-content- gmail-and-when-i-try-to-forward-the) – Shaggy