node.js生成的链接上未加载Css

我使用的是node.js、express和mysql。我已经成功地按照以下说明来包含我的css文件:How can I include css files using node, express, and ejs? css确实加载到每个页面上,除了一个在url中包含id的链接:

http://localhost:8089/edit/123

当用户单击表格行中的“编辑”链接时,将传递上一页的最后一个数字。此编辑页上未加载样式。它确实在其他地方加载。我的node.js服务器文件:

app.use(express.static(__dirname + '/public'));

该edit.html与其他页面位于相同的“视图”文件夹中。css链接与html中的相同:

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

有没有人能帮我解决这个问题?

转载请注明出处:http://www.xingnongyuan.com/article/20230526/1501274.html