> All in One 586: Adding CSS to a Page via HTTP Headers

Ads

Wednesday, June 3, 2020

Adding CSS to a Page via HTTP Headers

Only Firefox supports it, but if you return a request with a header like this:

Header add Link "<style.css>;rel=stylesheet;media=all"

…that will link to that stylesheet without you having to do it in the HTML. Louis Lazaris digs into it:

[…] the only thing I can think of that could justify use for this in production is as a way to include some Firefox-only CSS, which Eric Meyer mentions as a possibility in an old post on this subject. But it’s not guaranteed to always only work in Firefox, so that’s still a problem.

Do with this what you like, but it’s extremely unlikely that this will have any use in a real project.

I appreciate some classic CSS trickery.

Direct Link to ArticlePermalink

The post Adding CSS to a Page via HTTP Headers appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2yTbBMk
via IFTTT

No comments:

Post a Comment

Clear/Wind today!

With a high of F and a low of 66F. Currently, it's 82F and Clear outside. Current wind speeds: 19 from the South Pollen: 0 Sunri...