Home > Web Front-end > CSS Tutorial > How to use @charset rules

How to use @charset rules

青灯夜游
Release: 2019-02-12 16:32:21
Original
3690 people have browsed it

In CSS, the @charset rule is used to specify the character encoding used in the style sheet; it must be the first element in the style sheet. If multiple @charset rules are defined, only the first one will be used. The following article will introduce you to the @charset rules. I hope it will be helpful to you.

How to use @charset rules

CSS @charset rules

@charset rules must be at the beginning of the style sheet, not before it Any elements (characters), not even comments.

After "@charset", specify the name of the character encoding (in quotes). For example:

@charset "utf-8";
Copy after login

Note: The @charset rule cannot be used in the