Put CSS and JavaScript in files or main HTML?

后端 未结 6 1173
-上瘾入骨i
-上瘾入骨i 2020-12-25 15:00

Although it is always recommended to put JavaScript and CSS code into appropriate files (as .js and .css), most of major websites (like Amazon, fac

6条回答
  •  醉梦人生
    2020-12-25 15:18

    An interesting investigation might be whether they include various .css files regardless of the style blocks you're also seeing. Perhaps it's overhead or perhaps it's convenience.

    I've found that while working with different styles of interface developer (and content deployers) that convenience/authority often wins in the face of deadlines and "getting the job done". In a project of a large scale there could be factors involved like "No, you ain't touching our stylesheets", or perhaps if there isn't a stylesheet using an http request already then convenience has won a battle against good practice.

提交回复
热议问题