【问题标题】:(Grails) GSP with semanticui(Grails) 带有语义的 GSP
【发布时间】:2015-10-31 11:19:03
【问题描述】:

这就是我的文件夹的样子

我有两个文件,一个是 gsp,一个是 html,这两个文件的代码完全相同

<html>
<head>
<link rel="stylesheet" type="text/css" href="dist/semantic.min.css">
<script src="semantic/semantic.min.js"></script>
</head>
<body>
    haluaw
    <button class="ui primary button">
  Save
</button>
<button class="ui button">
  Discard
</button>
</body>
</html>

这就是gsp的样子

这就是它在 html 中的样子

为什么它在 gsp 中不起作用,而在 html 中起作用。它的文件夹和代码相同

【问题讨论】:

    标签: html grails gsp semantic-ui


    【解决方案1】:

    这是因为 gsp 的 CSS 路径是错误的。 html 文件查找文件夹结构,并找到 CSS 文件。但是,Grails 应用程序在服务器 URL 上查找 css 文件。

    您应该将 CSS 和 js 文件放在 grails 应用程序的 webapp 文件夹中,并提供正确的 url 路径。

    【讨论】:

    • 谢谢!不知道它必须放在某个文件夹中
    猜你喜欢
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多