我正在使用linemanjs创建一个web应用程序,但是当我显式地引用供应商css和js文件时,它不会引用该位置。让我知道我对linemanjs做错了什么。
我在文件里试过的简单方法是-
link(rel="stylesheet",href="/vendor/css/myvendor.css")
和
link(rel="stylesheet",href="/css/myvendor.css")
和
link(rel="stylesheet",href="css/myvendor.css")
-> myvendor.css肯定位于供应商下的css文件夹中。
发布于 2014-07-18 09:45:51
因为不使用基本HTML的基本标记:
<link rel="stylesheet" type="text/css" href="css/myvendor.css">必须包含标记(如果必须是服务器或客户端的)的路径。
如果文件夹供应商包含所有文件html和包含用于站点的文件的文件夹,则前面标记中包含的路径是正确的。
如果仍然不包括这个文件css,问题是文件不存在或声明错误的文件名或结构css的错误(最好是您发布css文件),但我认为您发现了检查元素或Firebug (为火狐或Chrome添加)的问题。
更新:如果您使用Jade,则在you标记中添加'type='text/css',因为定义文件类型更好。
link(rel='stylesheet', href='css/myvendor.css', type='text/css' )阅读玉器文献和on
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>https://stackoverflow.com/questions/24821344
复制相似问题