2 に答える
While setting the correct encoding is always a good thing to do, I try to avoid this situation entirely and use only ASCII characters in HTML, JavaScript and CSS:
content:"\2014"
Unicode characters are represented by \hexValue
in CSS.
Beware that if the following character is 0-9
or a-f
(or A-F
), it will be considered part of the unicode character. You can put a space after it: "\2014 stuff"
, and the space won't be displayed (it just marks the end of the character). To actually put a space after it, use two spaces.
スタイルシートの上に以下を追加してみてください
@charset "UTF-8";
HTTP サーバー (Apache、Nginx など) が別の文字セットを指定している可能性があります。次のように応答する必要があります。
Content-Type: text/css; charset=UTF-8
詳細については、http://www.w3.org/を参照してください。