CSS樣式表是一個序列通用字符集,傳輸和存儲過程中,這些字符必須由支持 US-ASCII(例如 UTF-8, ISO 8859-x, SHIFT JIS 等)字符編碼方式編譯
文檔內(nèi)嵌樣式表編碼
When a style sheet is embedded in another document, such as in the STYLE element or “style” attribute of HTML, the style sheet shares the character encoding of the whole document.
當(dāng)樣式出現(xiàn)在其它文檔,如 HTML 的 STYLE 標(biāo)簽或標(biāo)簽屬性 “style”,樣式的編碼由文檔的決定。
文檔外鏈樣式表編碼
When a style sheet resides in a separate file, user agents must observe the following priorities when determining a style sheet’s character encoding (from highest priority to lowest):
An HTTP “charset” parameter in a “Content-Type” field (or similar parameters in other protocols)BOM and/or @charsetor other metadata from the linking mechanism (if any)charset of referring style sheet or document (if any)Assume UTF-8
Authors using an @charset rule must place the rule at the very beginning of the style sheet, preceded by no characters. (If a byte order mark is appropriate for the encoding used, it may precede the @charset rule.)
@charset must be written literally, i.e., the 10 characters ‘@charset “‘ (lowercase, no backslash escapes), followed by the encoding name, followed by ‘“;’.
更多建議: