【发布时间】:2017-08-14 05:39:41
【问题描述】:
今天在将邮件从 Outlook 发送到 Gmail 时遇到了一个新问题。问题是超链接元素显示为下划线。 我在下面试过了。
方法一:
<td width="500px" align="center" style=" text-align: left; font-size:1.2em; font-family:Candara; color: #FFFFFF;">
<a href="mailto:info@example.com" style="color:#fff;text-decoration:none;" target="_blank">info@xxx.com</a>
</td>
方法二:
<a href="mailto:info@example.com" style="color:#fff;text-decoration:none !important;" target="_blank">info@ccc.com</a>
方法三:
a {text-decoration: none !important; color: #000; cursor: text;}
此代码在浏览器、outlook 中运行良好,问题出在 Gmail 邮箱中。因为 Gmail 在超链接标签后动态附加 span 标签。
我在这里附上了视频参考:
Given: text-decoration none 它没有被 gmail 盒子采用,因为在 span 标签中添加了一个标签之后。
完整代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mailtest</title>
</head>
<body style="margin:0; padding:0;">
<table width="582" border="0" cellspacing="0" cellpadding="0" align="center" style="background:black;">
<tr>
<td width="500px" align="center" style=" text-align: left; font-size:1.2em; font-family:Candara; color: #FFFFFF;">
<img style="margin-left:10px;" src="http://codestrz.com/Content/mail/envelope.png" alt="" border="0" height="18" width="18"/>
<a href="mailto:info@example.com" style="color:#fff;text-decoration:none" target="_blank">info@xxx.com</a>
</td>
</tr>
</table>
</body>
</html>
我已经尝试过这个简单的标签:
<p style="color:white;"> EXTRANET.EXAMPLE.COM</p>
后来尝试了没有链接的简单p标签,
[![enter code here][1]][1]
【问题讨论】:
-
您能否向我们展示带有附加
<span>的代码是什么样的? -
请看上面提到的视频,它会清楚地显示出来
-
你的 Outlook 版本是多少?
-
@Narendhran 展望 2013
-
然后在你的 CSS 中, .myClass,.myClass1{ text-decoration: none;颜色:#FFFFFF; }