【发布时间】:2014-04-04 01:53:44
【问题描述】:
我正在学习使用 Clojure 进行 Web 开发的基础知识,但似乎无法使用 Hiccup 让我的 css 工作。我已经测试了几个可能的文件路径,尝试使用标签手动设置链接,甚至尝试在 .css 文件的顶部添加 html5, 行。似乎没有任何工作。我确信有一种惯用的方式来做到这一点,我只是不知道。如果有人能告诉我如何一起使用打嗝和 css 以保证它可以工作,我将非常感激。
我的目录有这个树形结构:
.____resources
| |____public
| |____404.html
| |____500.html
| |____home.css <- I want to see this augmenting the html5 in home from the landing.clj, below.
|____src
|____clojuregrade
|____landing.clj <- home function with html5 is here.
|____web.clj
我在上面的landing.clj中有这个功能:
(defn home [& [weights grades error]]
(html5
[:head
[:title ...]
(include-css "/public/home.css")] ;; <- Is this right?
[:body
(form-to [:post "/"]
(text-area ...)]
(text-area ...)]
(submit-button "process"))]))
我在上面的 home.css 中有这段代码:
body {
background-color: #BAC4E8;
}
h1 {
font-family: Garamond;
color: #29507A;
}
注意:我已经删减了上面的代码来尝试概括这个问题,以使其对未来的用户有用。
【问题讨论】:
标签: css html clojure path hiccup