3
4

4 回答 4

14

Probably the text encodings (character sets) for your CSS and HTML files do not agree.

To set a stylesheet's encoding, use @charset; for example:

@charset "UTF-8";

To set an HTML page's encoding, use a <meta> tag (in the <head> section at the top); for example:

<meta http-equiv="Content-type" content="text/html;charset=utf-8">

or in HTML 5:

<meta charset="UTF-8">

The @charset of a stylesheet must agree with the encoding chosen for its HTML page.

于 2012-07-27T04:13:40.810 回答
2

The reason is that the BLACK STAR “★” (U+2605) appears as UTF-8 encoded in the source that contains the CSS code, but that source is being interpreted as ISO-8859-1 encoded. The fix depends on where the CSS code is, on the server software, etc.

See Declaring character encodings in CSS.

于 2012-07-27T09:41:22.843 回答
1

You can also specify it in its hexadecimal value, without adding the character encoding declaration.

Instead of:

content: '★';

it should be:

content: '\2605';

You can look it up here:

https://graphemica.com/%E2%98%85

于 2021-08-06T12:30:32.727 回答
0

In the slick-theme.css file i had : @charset 'UTF-8' , the single quote marks where the problem , i changed them to double quotes like so : @charset "UTF-8". And it worked

于 2018-10-05T11:04:11.743 回答