<td width="110" align="center" valign="top" style="color:#000000;">
<a href="https://example.com" target="_blank"
style="color:#000000; text-decoration:none;">BOOK NOW
</a>
</td>
I used this code to make a link in my HTML email. In browsers and Outlook it's working nicely, but in GMail, Hotmail, and ymail it shows links underlined.
Can anyone help me to get rid of this?
Code like the lines below worked for me in Gmail Web client. A non-underlined black link showed up in the email. I didn't use the nested
span
tag.Note: Gmail will strip off any incorrect inline styles. E.g. code like the line below will have its inline styles all stripped off.
Outlook will strip out the style with
!important
tag leaving the regular style, thus no underline. The!important
tag will over rule the web based email clients' default style, thus leaving no underline.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
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)
Use
text-decoration:none !important;
instead oftext-decoration:none;
to make sure you "lose" the underline.To completely "hide" underline for
<a>
in both mail application and web browser, can do the following tricky way.Color in 1st
<span>
is the one you don't need, MUST set as same as your background color. (red in here)Color in 2nd
<span>
is the one for your button text. (white in here)While viewing the html email try inspecting the element on that link and see what is overwriting it. Use that class and define it that style again in your head style and define the text-decoration: none !important;
In my case these are the classes that are overwriting my inline style so declared this on the head of my html email and defined the style that I want implemented.
It worked for me, hope it will work on your one too.