css3 - css before 中文乱码?
ringa_lee
ringa_lee 2017-04-17 11:40:06
0
2
751

给css :before 添加中文出现乱码该怎么解决?

.more-text:before {
    content: '更多>';
    display: inline;
}

转成unicode怎么还是不能用?
.more-text:before {
    content: '\u66f4\u591a\u0026\u0067\u0074\u003b';
    display: inline;
}
ringa_lee
ringa_lee

ringa_lee

reply all(2)
洪涛

Check whether the encoding of the css file and the encoding of the html document are consistent.
It is better to use all utf-8. You can also try adding @charset "utf-8";

to the css document header

unicode use content: '66F4 591A >';

You can use this conversion https://r12a.github.io/apps/conversion/ The one in the bottom corner is css

左手右手慢动作

Method 1:
Check the encoding format of HTML files and CSS files and use unified encoding.

Method 2:
Try not to include Chinese characters in CSS and JS. If you must have it but are afraid of problems, you can convert Chinese into unicode.
You can go here to convert: tool.chinaz.com/Tools/Unicode.aspx

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template