banner
MACSITE

@MACSITE

兴趣是学习的动力,学习也能成为消遣!--你愁啥-ncs.fun

Prevent Chinese characters from displaying as garbled text in CSS -- @charset

xlog does not modify file permissions, it only supports changing and beautifying CSS styles. Therefore, if you want to add text in the desired location, you can only use CSS to add text. Not setting @charset can easily result in garbled characters.

Code:

@charset "UTF-8";
/* Prevent Chinese garbled characters when adding CSS - The @charset property specifies the character encoding used in the style sheet (.css extension) and can only be used in CSS files.
It must be the first element in the style sheet, with no preceding characters, not even comments. If multiple @charset rules are declared, only the first one will be used, and it cannot be used in HTML elements or within HTML pages, i.e., it cannot be used within <style> elements. */

Effect after adding:

X$F0~P)Y58{(CBP%RN_AP}5
I also encountered garbled characters recently 😅, but it's never too late to mend!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.