[英]How to prevent html link underline in when sent from outlook to gmail?
I try to copy-paste rendered html that includes anchor tag to outlook, for example: 我尝试将包含锚标记的渲染html复制粘贴到outlook,例如:
<a href="tel:1000000000" style="text-decoration: none; color: #4e4b4c;">1000000000</a>
(I select the rendered html with right click -> select all) (我选择右键单击渲染的html - >全选)
but when I send the mail to gmail I receive the links with underline. 但当我发送邮件到Gmail时,我会收到带下划线的链接。 I tried to give this element
text-decoration: none;
我试图给这个元素
text-decoration: none;
style but it doesn't work. 风格,但它不起作用。
Here is a code example: https://codepen.io/anon/pen/WdKrvj 这是一个代码示例: https : //codepen.io/anon/pen/WdKrvj
On outlook (sending side): outlook after copy-paste 在outlook(发送方): 复制粘贴后的前景
On gmail (receiving side): gmail after receiving 在gmail(接收方): 收到后的Gmail
Thanks! 谢谢!
The links are placed because Gmail places a list style around your link example: 放置链接是因为Gmail会在链接示例周围放置一个列表样式:
.ii a[href] { color: #15c; }
A way around this is add a span around your phone number (or address) 解决此问题的方法是在您的电话号码(或地址)周围添加一个范围
<span class="contact">675 Massachusetts Ave.<br>Cambridge, MA 02139, USA</span>
Then using CSS you can target that specific element and set it's style 然后使用CSS,您可以定位该特定元素并设置它的样式
.contact a {color:#000000!important; text-decoration:underline!important;}
Full article (with second option) can be found here. 完整的文章(有第二个选项)可以在这里找到。
Hope that answers your question. 希望这能回答你的问题。
Sometimes I've found inlining a text-decoration: none;
有时我发现内联
text-decoration: none;
isn't enough. 还不够。 Annoying, right?
讨厌,对吧? I've added the following code to bulletproof auto-detected links like this.
我已经添加了以下代码来防止像这样的自动检测链接。 Basically add a class to any parent element (like a
<td>
or <div>
) that might contain a phone number or mailing address that an email client might detect. 基本上将类添加到任何父元素(如
<td>
或<div>
),其中可能包含电子邮件客户端可能检测到的电话号码或邮寄地址。
CSS: CSS:
<style>
*[x-apple-data-detectors], /* iOS */
.x-gmail-data-detectors, /* Gmail */
.x-gmail-data-detectors *,
.aBn {
border-bottom: 0 !important;
cursor: default !important;
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
</style>
HTML: HTML:
<td class="x-gmail-data-detectors">
<a href="tel:1000000000" style="text-decoration: none; color: #4e4b4c;">1000000000</a>
</td>
I've seen this generally work, though depending on which flavor of Gmail you're testing, results might vary. 我已经看到这通常有用,但根据您正在测试的Gmail的风格,结果可能会有所不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.