Luc*_*epe 16 css3 thymeleaf spring-boot
我有CSS和Thymeleaf的问题.
在我的Spring启动应用程序中,我有这样的结构:
现在,我的html页面名为ErrorPage,css文件名为Layout.css,使用Thymeleaf,我在ErrorPage的头部:
<link href="../css/Layout.css" th:href="@{css/Layout.css}" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
但这不起作用.
我究竟做错了什么?
Dim*_*San 27
将template
文件夹移到右下方resources
:
src/main/resource/static/css
(对于CSS文件);src/main/resource/templates
(对于HTML模板).然后link
按如下方式更正标记:
<link href="../static/css/Layout.css" th:href="@{/css/Layout.css}" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
28507 次 |
最近记录: |