简体   繁体   English

从outlook发送到gmail时如何防止html链接下划线?

[英]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.

相关问题 Outlook 2007更改HTML电子邮件中的链接样式,以便在发送到Hotmail,Gmail等时使用蓝色下划线。是否有任何修复? - Outlook 2007 changes link styles in a HTML email to have a blue underline when sent to Hotmail, Gmail, etc. Any fixes? 如何从 Outlook 和 Gmail 中的超链接中删除下划线 - How to remove underline from hyperlink in outlook as well as gmail 从Outlook中删除下划线gmail超链接 - Remove underline gmail hyperlink from outlook 如何从HTML链接中删除下划线? - How to remove underline from a link in HTML? 如何从UILabel的html链接中删除下划线? - How to remove underline from html link in UILabel? 从 Outlook 发送电子邮件模板时如何删除 Gmail 中的超链接下划线 - How to Remove Hyperlink underline in Gmail while sending Email template from outlook 从Django发送时,Gmail无法使用html正确呈现电子邮件 - Gmail not rendering email with html breaks properly when sent from Django 如何防止Gmail从地址创建地图链接? - How to prevent Gmail from creating map link from address? 如何防止 Android 的 Outlook 将数字格式化为链接 - How to prevent Outlook for Android from formatting number into a link HTML电子邮件内部链接在Outlook和Gmail移动应用中不起作用 - HTML Email Internal link not working in Outlook and Gmail mobile app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM