【发布时间】:2014-10-22 10:51:14
【问题描述】:
我正在尝试渲染外部样式表。我不确定为什么这不起作用:
去:
func main() {
http.HandleFunc("/", homeHandler)
http.HandleFunc("/image/", imageHandler)
http.Handle("/layout/", http.StripPrefix("/layout/", http.FileServer(http.Dir("layout"))))
http.ListenAndServe(":8000", nil)
}
目录结构:
gocode
layout
stylesheets
home.css
home.html
main.go
HTML:
<link rel="stylesheet" type="text/css" href="/stylesheets/home.css" />
怎么了?我按照这里的例子:Rendering CSS in a Go Web Application
【问题讨论】:
标签: go