Gmail stripping link color from emails?

2019-04-20 10:20发布

问题:

Everything renders fine apart from link colors.. These are my links.

<a href="http://www.facebook.com.." style="color:#000000;text-decoration:none;font-weight:bold">Facebook</a>

<a href="http://www.twitter.com/..." style="color:#000000;">Twitter</a>

However, in gmail. These links are converted to this.

<a href="http://www.facebook.com.." style="text-decoration:none;font-weight:bold">Facebook</a>

<a href="http://www.twitter.com/..." style="">Twitter</a>

OK, so maybe gmail does this for all emails? I look around. Lots of blue links. I then open up a youtube message.

<a target="_blank" style="color:#e12e31;font-family:arial,verdana,sans-serif;text-transform:uppercase;text-decoration:none" href="...">Play all »</a>

Curious.. very curious. YouTube isn't having this problem that I am having. Can anyone else modify link colors in gmail when sending html emails? How are you doing it?

回答1:

I had a similar problem with links in Gmail, but only when color: #000000; it changed it to the default blue.

I changed the color to a very dark grey and it worked.



回答2:

GMail will change your links from black (#000000) to the default blue, presumably as an anti-spamming feature.

To get around this, just change the color of the font to (#000001), e.g.

<a href="#" style="color: #000001;">Click HERE</a>


回答3:

Combining the answers here worked like a charm for me, eg:

color: #000001 !important;

I hope we aren't helping spammers and such here...



回答4:

What I did for my email signature, is put the phone number with a middle dot instead of a dash, like this 226·860·XXXX, no more blue hyperlink! hope this helps someone



回答5:

I'm able to set color links just adding the following style in email head:

<style>
      a, a:visited, .ii a[href] { color:#E5322C!important; text-decoration:none;}
      a:hover, .ii a[href]:hover{ text-decoration:underline;}
</style>

the only caveat is that the "a" selector is not enough, because Gmail adds a rule to .ii a[href], but adding rules for that selector fixes my links color issue. It works even on URLS, emails and telephone numbers that are converted into links by Gmail. There's no need to add inline styling.



回答6:

You have to make sure that the you are inserting the code in the appropriate spot in your HTML, prior to the text you want to link up (obviously) and that the style="color:#ffffff;" element is properly nested within the tag.

And of course don't forget to include your </a> tag on the backside of the text link. This works fine for me when viewing in Gmail.

<a target="_blank" style="color:#ffffff;"  href="http://yoursite.com">Custom Color Link in Gmail</a>