Gmail(或其他)正在更改我的班级名称吗? [英] Gmail (or something) is changing my class names?

查看:35
本文介绍了Gmail(或其他)正在更改我的班级名称吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,这很奇怪.我有一个要调整的HTML电子邮件模板.在模板中,我有一个标准的< ul> .但是,客户要求在列表上方没有保证金.所以,很容易.我刚刚添加了"margin-top:-10px"作为样式:

Ok, this is weird. I have an HTML email template that I am trying to adjust. In the template, I have a standard <ul>. But, the client has requested that there be no margin above the list. So, easy enough. I just added a `margin-top: -10px' as a style:

 <ul style="margin-top: -10px;">
     <li>....</li>
 </ul>

但是当我给自己发送电子邮件时,这种样式就被删除了.它显示如下:

But then when I sent myself the email, that style had been stripped out. It showed up like this:

 <ul>
     <li>....</li>
 </ul>

我以为它可能已被缓存.因此,我更改了顶部列表项的文本:

I thought maybe it was cached. So I changed the text of the top list item:

 <ul style="margin-top: -10px;">
     <li>This is a test</li>
 </ul>

然后我给自己发送了电子邮件,我得到了:

Then I sent myself the email, and I got this:

 <ul>
     <li>This is a test</li>
 </ul>

所以,我上了一堂课:

.UlNoTopMargin {margin-top: -10px;}

是这样做的:

 <ul class="UlNoTopMargin">
     <li>This is a test</li>
 </ul>

我给自己发送了电子邮件,我得到了:

I sent myself the email, and I got this:

<ul class="m_4942690989181909996UlNoTopMargin">
     <li>This is a test</li>
 </ul>

什么是$ @#!@ !!在这里吗?我正在使用gmail查看电子邮件.Gmail是否正在这样做?如果不是,那么这到底是哪里来的?

What the $@#!@!! is going on here? I'm using gmail to view the emails. Is Gmail doing this? If not, then where on earth is this coming from?

推荐答案

Gmail绝对会更改您电子邮件中的类名.如果创建样式表并将其发送出去,它将更改样式表和电子邮件正文中的类名.它还会去除所有不支持的样式,有时甚至是整个工作表.

Gmail absolutely changes classnames in your email. If you create a style sheet and send it out, it will change the classnames in the style sheet and in the email body. It will also strip out any styles that it doesn't support, sometimes the entire sheet.

这些是Gmail支持的CSS属性和查询:

These are the CSS properties and queries supported by Gmail:

https://developers.google.com/gmail/design/reference/supported_css

祝你好运.

这篇关于Gmail(或其他)正在更改我的班级名称吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆