CSS encoding.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 28 Jan 2017 15:22:09 +0200
changeset 2067 700f340fa4ef
parent 2066 3d76849f1abf
child 2068 cd5c05825627
CSS encoding.
css.rst
--- a/css.rst	Sat Jan 28 14:38:54 2017 +0200
+++ b/css.rst	Sat Jan 28 15:22:09 2017 +0200
@@ -59,6 +59,27 @@
 
   <b style="color: blue; font-family: ariel">Welcome!</b>
 
+CSS encoding
+============
+
+``@charset`` rule should be the first sequence in CSS document without preceding
+white spaces, should use double quotes and exactly one space between keyword and
+charset::
+
+  @charset "UTF-8";
+
+UTF BOM have precedence over ``@charset``.
+
+Another source of encoding is HTTP header ``Content-Type`` that have highest
+precedence::
+
+  Content-Type: text/css; charset=utf-8
+
+Using ``charset`` attribute on the ``link`` element is deprecated by HTML5.
+
+https://www.w3.org/International/questions/qa-css-charset.en
+  Declaring character encodings in CSS.
+
 Selectors
 =========
 ::