I see that most 404 pages (in Html5BoilerPlate for instance) have their CSS included in the page's Html code inside a <style>
tag instead of being linked from an external sheet. I'm pretty sure people do this on purpose and has some good reasons behind it but I can't get to figure out why they did this.
It's probably so you don't end up with another 404 trying to fetch an external stylesheet — which would be pretty ironic — and thus have an unstyled 404 page.
On a more serious note, you generally don't want any error pages incurring any additional HTTP requests, since they would be essentially a waste of server resources as well as bandwidth. Error pages are places you don't want users ending up, so you want to make sure they have as little impact on your server (and possibly others!) as possible.
This page is being served because something is missing or broken and the risk of the same issue not allowing the 404 page to load it's external css necessitates the inclusion of the styles in the page itself.
Not a required practice, but definitely a good idea.
© 2022 - 2024 — McMap. All rights reserved.