我知道这个问题之前已经被问过很多次了,所以如果我重复自己的话,我深表歉意,但是在遵循了很多其他关于这个的提示之后,我在 Gmail 中遇到了一些奇怪的行为。
如果我在浏览器中打开下面的代码,复制它然后将其粘贴到 Gmail sig 中(通过设置)文本遵循 text-decoration 属性(我使用的是 span 和!important
如其他帖子所建议)。
我现在可以创建/发送电子邮件并且样式得到尊重。
但是如果我退出 Gmail 然后再次登录,text-decoration:none
样式会突然被忽略。 “修复”的唯一方法是再次复制/粘贴签名(通过设置)。
我想知道 Gmail 中是否发生了某些变化,因为我已经使用这个 sig 一年左右了,直到最近我才注意到这种行为。
有没有其他人遇到过这种情况(或者可以看出我的代码有什么问题)?
<body>
<table width="98%" border="0" cellspacing="0" cellpadding="0" style="font-family:'Lucida Grande','Lucida Sans','Lucida Sans
Unicode';font-size:12px;margin:0px">
<tr>
<td>
<a href="http://maps.google.com?q=Mainframe North" target="_blank" style="text-decoration:none !important;color:rgb(180,180,180);">
<span style="text-decoration:none !important;color:rgb(180,180,180);">
82 Silk Street<br>Manchester M4 6BJ
</span>
</a>
</td>
</tr>
</table>
</body>
根据以下评论更新代码:
<table width="98%" border="0" cellspacing="0" cellpadding="0" style="font-family:'Arial';font-size:12px;margin:0px;color:#B4B4B4">
<tr>
<td>
<a href="http://maps.google.com?q=Mainframe North" target="_blank" style="text-decoration:none">
<span style="text-decoration:none;color:#B4B4B4">
82 Silk Street<br>Manchester M4 6BJ
</span>
</a>
</td>
</tr>
</table>
最佳答案
该问题是 Google 的 Webkit 布局引擎分支 Blink 的错误。在 Chrome 中查看 Gmail 设置页面时,“text-decoration:none”样式标签已从您的签名中永久删除。
不过我发现了一个 hack 来解决这个问题:
- 使用任何其他浏览器将您的 HTML 签名粘贴到 Gmail 设置中,
或执行以下操作:
- 右键单击签名中带下划线的元素并检查
- 在检查窗口中,将“text-decoration:none”添加回您的样式属性
- 在签名中引入空格等文本更改,以便激活“保存更改”按钮。
- 保存您的更改。
瞧,再也没有下划线了(或者至少在您再次更改签名之前)。
关于html - Gmail 签名 - 文字修饰 :none,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44113149/