Outlook mail deletes <a> tag, when <a> tag has no href

Minh Truong 0 Reputation points
2024-09-06T12:47:11.8866667+00:00
<a style="background: rgb(80, 80, 80); border: 5px solid transparent; border-radius: 5px; text-align: center; padding: 0px; width: 150px; height: 30px;">
	<span>Text</span>
</a>

With the <a> tag without href, when sending to Outlook mail (Outlook web), the <a> tag will be removed. This will cause the button to not display, only displaying text, the above phenomenon also occurs in the Outlook app in Microsoft Office 2021.

This phenomenon does not occur in other mail apps, and I cannot find any documentation that talks about this issue. So I want to confirm that when the <a> tag does not have href, Outlook will remove the <a> tag, is that correct ?

Thanks.

Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.