WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2025 Poal.co

254

It does obviously not bother me, but I am just wondering whether there is a technical reason for having the CSS contents inline in the HTML source code, instead of a dedicated .CSS file, referenced to using <link rel="stylesheet" href="custom.css" />.


About the priority: I know that whichever comes last out of two identical CSS references (whether in the same style sheet or multiple style sheets of the same page), has the higher priority.

Whether a style sheet CSS is embedded in the HTML source code (<style> … </style>) or outsourced to a separate file (<link rel="stylesheet" href="stylesheet_filename.css" />) makes no difference in terms of priority, as long as the tags are at the same position.

But is there a technical reason for having the custom style sheet inside the HTML source code instead of a separate file?

It does obviously not bother me, but I am just wondering whether there is a technical reason for having the CSS contents inline in the HTML source code, instead of a dedicated .CSS file, referenced to using `<link rel="stylesheet" href="custom.css" />`. ---- About the priority: I know that **whichever comes last** out of two identical CSS references (whether in the same style sheet or multiple style sheets of the same page), has the higher priority. Whether a style sheet CSS is embedded in the HTML source code (`<style> … </style>`) or outsourced to a separate file (`<link rel="stylesheet" href="stylesheet_filename.css" />`) makes no difference in terms of priority, as long as the tags are at the same position. But is there a **technical** reason for having the custom style sheet inside the HTML source code instead of a separate file?

(post is archived)

[–] 1 pt

But is there a technical reason for having the custom style sheet inside the HTML source code instead of a separate file?

I'd argue there is. From an implementation perspective it's easiest to simply have the custom CSS copied from a database field into the template which renders your page.

This functionality could also be implemented in such a manner, that the same content is returned when the user accesses some url like /userdata/custom.css. But that's additional work. So why bother, if it works as inline code?

The only upside would be, that the responses are slightly shorter, and it may very well be, that the bottleneck is not bandwidth but processing power.