How do I remove link underlining in my HTML email?

后端 未结 23 1743
自闭症患者
自闭症患者 2020-12-08 15:02

    

        
相关标签:
23条回答
  • 2020-12-08 15:06

    All email clients adjust the HTML and the CSS code you provide by their own rules:

    e.g.: gmail removes everything but the inner HTML of the body tag.

    1. for most other clients you can have a style-tag in your header

    <style type="text/css">
        a {text-decoration: none !important;}
    </style>
    

    note: don't use CSS comments as YAHOO!Mail might cause trouble.

    2. to be on the save side add the same code inline into the A tag as you did and an extra span tag as well (the style rules in a tags get often removed)

    <a href="" style="text-decoration: none !important;">
        <span style="text-decoration: none !important;">
            text
        </span>
    </a>
    
    0 讨论(0)
  • 2020-12-08 15:06

    It wholly depends on the email client whether it wants to display the underline under the link or not. As of now, the styles in the body are only supported by:

    • Outlook 2007/10/13 +
    • Outlook 2000/03
    • Apple iPhone/iPad
    • Outlook.com
    • Apple Mail 4
    • Yahoo! Mail Beta

    http://www.campaignmonitor.com/css/

    0 讨论(0)
  • 2020-12-08 15:08

    You can do "redundant styling" and that should fix the issue. You use the same styling you have on the but add it to a that is within the .

    Example:

    <td width="110" align="center" valign="top" style="color:#000000;">
        <a href="https://example.com" target="_blank"
           style="color:#000000; text-decoration:none;"><span style="color:#000000; text-decoration:none;">BOOK NOW</span></a>
    </td>
    
    0 讨论(0)
  • 2020-12-08 15:09

    I think that if you put a span style after the <a> tag with text-decoration:none it will work in the majority of the browsers / email clients.

    As in:

    <a href="" style="text-decoration:underline">
        <span style="color:#0b92ce; text-decoration:none">BANANA</span>
    </a>
    
    0 讨论(0)
  • 2020-12-08 15:11

    I added both declarations on the a href which worked in outlook and gmail apps. outlook ignores the !important and gmail needs it. Web versions of email work with both/either.

    text-decoration: none !important; text-decoration: none;
    
    0 讨论(0)
  • 2020-12-08 15:14

    After half a day looking into this (and 2 years since this question was opened) I believe I have found a comprehensive answer to this.

    <a href="#"><font color="#000000"><span style='text-decoration:none;text-underline:none'>Link</span></font></a>
    

    (You need the text-underline property on the span inside the link and the font tag to edit the colour)

    0 讨论(0)
提交回复
热议问题