因为没有使用基本 HTML 的这个基本标记:
<link rel="stylesheet" type="text/css" href="css/myvendor.css">
如果必须是服务器或客户端,则必须包含标记的路径。
如果文件夹vendor包含所有文件html和包含您用于站点的文件的文件夹,则我之前包含在标签中的路径是正确的。
如果仍然不包含这个文件 css ,问题是文件不存在或声明错误的文件名或结构 css 错误(最好发布文件 css)但我认为你找到了Inspect Element 或 Firebug(firefox 和 [也许] Chrome 的附加组件)的问题
更新:啊,如果您使用 Jade,请在 you 标签内添加 'type='text/css',因为您最好定义文件类型。
link(rel='stylesheet', href='css/myvendor.css', type='text/css' )
阅读documentation of 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
!!!
或者在其他question on StavkoverFlow发布了其他解决方案
head
title test include
| <style type='text/css'>
include css/myvendor.css
| </style>