简体   繁体   中英

(Grails) GSP with semanticui

So this is how my folder looks like

在此处输入图片说明

I have two files one is gsp one is html and this is the exact same code for both

<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>

this is how gsp looks like

在此处输入图片说明

and this is how it looks like in html

在此处输入图片说明

Why does it not work in gsp while it works in html.. Its same folder and same code

This is because of path to CSS is wrong for gsp. The html files looks for the folder structure, and it finds the CSS file. But, Grails applications looks for css files on server URL.

You should be placing the CSS and js files in webapp folder in grails application and provide correct url path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM