Dofactory.com
Dofactory.com
Earn income with your CSS skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

CSS @charset

The @charset rule defines the character encoding in a stylesheet.

If used, it must be the first line in the stylesheet.

Example

#

This rule specifies a UTF-8 character encoding.

@charset "UTF-8";

Using @charset

This rule must be the first line in the stylesheet.

@charset cannot be used inside a style attribute.

It also cannot be used inside a <style> element.

This rule is helpful when non-ASCII characters are used in certain CSS properties, such as content.

Syntax

@charset "charset";

Values

#

Value Description
charset The character encoding, such as UTF-8 and iso-8859-15.

Browser support

This table shows when @charset support started for each browser.

Chrome
2.0 May 2009
Firefox
1.5 Nov 2005
IE/Edge
Not Supported
Opera
9.0 Jun 2006
Safari
4.0 Jun 2009

You may also like


Last updated on Sep 30, 2023

Earn income with your CSS skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides