<link rel="stylesheet" href="/static/oxygen-fontfacekit/stylesheet.css" charset="utf-8" />
以这种方式指定字符集是否有效,或者是由Content-Type响应头确定的字符集?
解决方法
The idea is that the browser would be able to apply the right encoding to the document it retrieves if no encoding is specified for the document in any other way. The use of this attribute on an
a
orlink
element is currently deprecated by the HTML5 specification,so you should avoid using it on those elements.In addition,there are some things to consider before using this attribute. Firstly,it is not well supported by major browsers.Secondly,it is hard to ensure that the information is correct at any given time. The author of the document pointed to may well change the encoding of the document without you knowing. If the author still hasn’t specified the encoding of their document,you will now be asking the browser to apply an incorrect encoding. And thirdly,it shouldn’t be necessary anyway if people follow the guidelines… and mark up their documents properly.