- coding em dash when pasting using CSS: after

I get the old one â€"on my page when I try to display em dash ( ). I think this can be cleaned up by adding <meta charset="utf-8">to the title of the document. But in this case, I embed em dash through css.

.el:after{
   content: "— content to be after";
}

Somehow it is incorrectly encoded. content: "&mdash;";also does not work; it only displays amersand code. How can i solve this?

+4
source share
2 answers

When properly configured, the correct encoding, I always try to completely avoid this situation and use only ASCII characters in HTML, JavaScript and CSS:

content:"\2014"

Unicode characters are represented \hexValuein CSS.

, 0-9 a-f ( a-f), . : "\2014 stuff", ( ). , .

+6

@charset "UTF-8";

HTTP- (Apache, Nginx ..), , . :

Content-Type: text/css; charset=UTF-8

. http://www.w3.org/

+1

All Articles