This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

@charset

Summary

Specifies the character encoding of the style sheet.

Examples

Set the character encoding of the style sheet to Unicode UTF-8 (recommended)

@charset "UTF-8";

Set the character encoding of the style sheet to Cyrillic (Windows 1251)

@charset "Windows-1251";

Notes

Remarks

You can use only one @charset rule in an external style sheet. The rule must appear at the top of the file, cannot be preceded by any characters, and cannot be included in an embedded style sheet.

The rule has no default value.

Syntax

@charset CharSet-Description

Parameters

CharSet-Description
String that specifies the name of the character encoding.

Standards information

Related specifications

Cascading Style Sheets Level 2 Revision 1 (CSS 2.1)
Recommendation

See also

Related articles

Syntax

Attributions