We are building Email content with HTML, most of the content is wrapped in anchor tags. I am trying to hide underlines of anchor tag.
I tried 'text-decoration: none;' on the anchor tag, which hides underline when opened in Outlook app on the PC. But links still appears in mobile version of Outlook (both ios and android).
<a href="my-link" style="font-family:Arial; font-weight:bold; text-decoration:none;"> Link Title </a>
These are the other alternatives i have tried to hide underlines on mobile.
- Add additional 'text-decoration' with '!important'
<a href="my-link" style="font-family:Arial; font-weight:bold; text-decoration:none !important; text-decoration:none;"> Link Title </a>
- Wrapped anchor tag with 'span'
<style type='text/css'>
a {text-decoration: none;}
</style>
<span>
<a href="my-link" style="font-family:Arial; font-weight:bold; text-decoration:none !important; text-decoration:none;"> Link Title </a>
</span>
- In the design, content is in 'td'. So added 'text-decoration: none;' to 'td' as well.
<td style='text-decoration:none;'>
<a href="my-link" style="font-family:Arial; font-weight:bold; text-decoration:none !important; text-decoration:none;"> Link Title </a>
</td>
But none of these seems to work. Can someone assist me with this ?
Updated with complete code:
I am building the table structure dynamically as below:
var myLink = '';
var myContent = '';
var trStyle = '';
var tdHeadStyle = '';
var tdTextStyle = '';
if(category === 'Letter'){
myLink = "<a href='"+dynamicURL+"' style='font-family:Arial;font-weight:bold;text-decoration:none;color:#FFFFFF;'>"+dynamicTitle+"</a>"
trStyle = "background-color:#979797; height:180px; padding:10px; font-family:Arial,Helvetica, sans-serif;"
tdHeadStyle = "color:#FFFFFF; font-family:Arial !important; font-size:28px; font-weight:bold;"
tdTextStyle = "font-family:Arial !important; font-size:18px;"
tdHTML += "<tr style='"+trStyle+"'"+
"<td colspan='2'>"+
"<table border='0' cellpadding='0' cellspacing='0'>"+
"<tr style='font-family:Arial,Helvetica, sans-serif;'>"+
"<td style='"+tdHeadStyle+"'>"+myLink+"</td>"+
"</tr>"+
"</table></td></tr>";
$('#emailLetter').append("<html lang='en'><head><style type='text/css'> a {text-decoration:none;} </style></head><body><table>"+tdHTML+"</table></body></html>");