HTTP Header Stylesheets

橙三吉。 提交于 2019-12-21 12:41:37

问题


According to this: http://www.w3.org/TR/html4/present/styles.html#h-14.6 I can link stylesheets directly in the http header. In php it would look like this:

header('Link: <http://www.acme.com/corporate.css>; REL=stylesheet');

are there any drawbacks in doing this?


回答1:


The main drawback is that it only works in Firefox and Opera. See http://greenbytes.de/tech/tc/httplink/.




回答2:


are there any drawbacks in doing this?

Debugging styling issues gets a little harder I guess. You can't directly see from the html source of a page what external styles get included.




回答3:


HTTP 1.1 doesn't support this feature from what I can see:

This section only applies to user agents conforming to versions of HTTP that define a Link header field. Note that HTTP 1.1 as defined by [RFC2616] does not include a Link header field (refer to section 19.6.3).

See http://www.w3.org/TR/html4/present/styles.html#h-14.6




回答4:


Note that HTTP 1.1 as defined by [RFC2616] does not include a Link header field



来源:https://stackoverflow.com/questions/8091996/http-header-stylesheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!