您的位置:首页技术文章
文章详情页

html - node.js中base标签中href的问题

【字号: 日期:2023-10-05 13:50:11浏览:70作者:猪猪

问题描述

我在node.js中的express中使用static中间件为static(__dirname+’/public’),html中的代码为html - node.js中base标签中href的问题

我想问一下base标签中的href属性为’/’是什么意思?不是一般都为http...这种属性值么?

问题解答

回答1:

app.use(express.static(__dirname+’/public’));这行代码是设置你的静态资源的base_url所以在页面中 <base href='https://www.haobala.com/'> /代表着你设置的静态资源路径

标签: HTML
相关文章: