因为不使用基本 HTML 的基本标记:
<link rel="stylesheet" type="text/css" href="css/myvendor.css">
如果必须是服务器或客户端,则必须包含标签的路径。
如果文件夹vendor包含所有文件 html 和包含您用于站点的文件的文件夹,则我之前包含在标记中的路径是正确的。
如果仍然不包含此文件css,则问题是文件不存在或声明错误的文件名或结构 css 错误(最好发布文件 css)但我认为您发现Inspect Element或Firebug的问题(附加对于 Firefox 和 [也许] Chrome)
更新:啊,如果您使用 Jade,'type='text/css'
请在您的标签内添加,因为您最好定义文件类型。
link(rel='stylesheet', href='css/myvendor.css', type='text/css' )
阅读JADE等文档
Template inheritance
If you have multiple views with a similar structure, you will end up with the same set of includes in all your views. This approach can quickly become complicated and untidy, if the number of views and includes increases.
使用 Jade,您可以生成包含 css 文件的标签:
!!! 5
html
head
title Learning Inheritance
link(rel='stylesheet', href='/css/myvendor.css')
body
!!!
或者在 StavkoverFlow 上的其他问题中发布了其他解决方案
head
title test include
| <style type='text/css'>
include css/myvendor.css
| </style>