更新时间: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" />