且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MIME类型('text/html')不是受支持的样式表

更新时间:2021-12-27 04:02:56

由于相对路径,您的html无法找到正确的CSS.将快递文件用作static是相对于快递路线path的,而不是实际的文件夹路径.

It's because of relative path that your html is unable to find the correct css. With express files served as static is relative to express route path not actual folder path.

由于public文件夹中的所有内容均作为静态对象,因此使用绝对路径可使事情变得更容易:

Since everything inside your public folder is served as statice, use absolute path, makes things easier:

<link rel="stylesheet" href="/style/draft.css" />