Search code examples
htmlcssemailhtml-email

HTML email select text in element


I am trying to add to an HTML email an element in this case an anchor where the content of this element "Hello" can be selected on click/on touch by the recipient.

<div>
  <a>Hello</a>
<div>

I have tried adding this style inlined:

-webkit-touch-callout: default;
  -webkit-user-select: all;
   -khtml-user-select: all;
     -moz-user-select: all;
      -ms-user-select: all;
          user-select: all;

but this inline style is ignored (stripped from the html when opening the email in gmail web app for example.


Solution

  • This is an advanced feature of CSS (CSS3) and as such most email clients do not support it. They barely support the basics!