(Grails) 带有 semanticui 的 GSP
(Grails) GSP with semanticui
这就是我的文件夹的样子
我有两个文件,一个是 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
中的样子
为什么它在 html 中可以工作而在 gsp 中却不能工作.. 相同的文件夹和相同的代码
这是因为 CSS 的路径对于 gsp 是错误的。 html 文件查找文件夹结构,并找到 CSS 文件。但是,Grails 应用程序在服务器 URL 上查找 css 文件。
您应该将 CSS 和 js 文件放在 grails 应用程序的 webapp 文件夹中,并提供正确的 url 路径。
这就是我的文件夹的样子
我有两个文件,一个是 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
中的样子为什么它在 html 中可以工作而在 gsp 中却不能工作.. 相同的文件夹和相同的代码
这是因为 CSS 的路径对于 gsp 是错误的。 html 文件查找文件夹结构,并找到 CSS 文件。但是,Grails 应用程序在服务器 URL 上查找 css 文件。
您应该将 CSS 和 js 文件放在 grails 应用程序的 webapp 文件夹中,并提供正确的 url 路径。