问题
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