Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do 404 pages include inline CSS [closed]

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.

like image 237
disklosr Avatar asked Mar 31 '14 15:03

disklosr


1 Answers

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.

like image 139
BoltClock Avatar answered Oct 18 '22 20:10

BoltClock