Declaring Character Set in CSS File

By Xah Lee. Date: . Last updated: .

By default, CSS file is assumed to be UTF-8 encoded, unless the server or other mechanism says otherwise.

However, you can declare it in your CSS file, by putting the following in the first line:

@charset "UTF-8";

For a introduction on Unicode, see: Unicode Basics: Character Set, Encoding, UTF-8

Reference

Syntax and basic data types#charset

[Declaring character encodings in CSS By W3C. At http://www.w3.org/International/questions/qa-css-charset.en.php , accessed on 2013-06-16 ]

CSS Misc

  1. Computed Style
  2. Pseudo Class vs Pseudo Element
  3. Media Query
  4. Variable
  5. calc
  6. Reset
  7. user-select
  8. Data URI Scheme
  9. protocol-relative URL
  10. Default Unit
  11. Declaring Character Set in CSS File
  12. Jargons Explained: Tag, Element, Node, Object, Attribute, Property, Method
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog