# HG changeset patch # User Oleksandr Gavenko # Date 1485609729 -7200 # Node ID 700f340fa4ef3a2c93985173c8d8f37f76e8c525 # Parent 3d76849f1abf8d9affd21f63de23a526e33eb08f CSS encoding. diff -r 3d76849f1abf -r 700f340fa4ef 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 @@ Welcome! +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 ========= ::