In this case, you can use Unicode escape values by preceding them with a
slash:

  .rarr:after { content: "\2192"; }


This is specified in the CSS 2.1 spec:
http://www.w3.org/TR/CSS2/syndata.html#characters

Personally, I probably would've just started on StackOverflow with this
question (e.g. [1]) but no harm done.


[1]:
http://stackoverflow.com/questions/10393462/placing-unicode-character-in-css-content-value

Sincerely,
    James Greene


On Fri, Feb 13, 2015 at 5:45 AM, David Sheets <kosmo...@gmail.com> wrote:

> Hello,
>
> I have a page with
>
> a <span class="rarr"><span>-&gt;</span></span> b
>
> and style
>
> .rarr span { overflow: hidden; height: 0; width: 0; display: inline-block;
> }
> .rarr::after { content: "→"; }
>
> (That's RIGHTWARDS ARROW x2192.)
>
> In Firefox 36, this copies and pastes like "a -> b" which is the
> desired behavior. In Chrome 40, this copies and pastes like "a  b".
>
> Is my desired behavior (to show unicode but copy an ASCII
> representation) generally possible? Are there specs somewhere about
> copy/paste behavior? I looked in <https://html.spec.whatwg.org/> but
> found nothing relevant.
>
> Is this the right venue for this question? Should I take it somewhere else?
>
> Thanks,
>
> David Sheets
>

Reply via email to