我知道类似的问题已发布数百次。但我找不到类似的东西。
我的基于 thymeleaf 的网页不加载静态内容。应用程序在 Spring Boot 上运行。 html 中声明的路径有问题吗?
在我的资源路径下面:
-resources
--static
---css
---img
---js
---etc.
以及页面头部的示例:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" th:href="@{/img/express-favicon.png}" type="image/x-icon" />
<title>RedCaynne Re</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link th:href="@{/vendors/material-icon/css/materialdesignicons.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet">
<link th:href="@{/vendors/linears-icon/style.css}" rel="stylesheet">
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/revolution/css/settings.css}" rel="stylesheet">
<link th:href="@{/vendors/revolution/css/layers.css}" rel="stylesheet">
<link th:href="@{/vendors/revolution/css/navigation.css}" rel="stylesheet">
<link th:href="@{/vendors/bootstrap-selector/bootstrap-select.css}" rel="stylesheet">
<link th:href="@{/vendors/bootatrap-date-time/bootstrap-datetimepicker.min.css}" rel="stylesheet">
<link th:href="@{/vendors/owl-carousel/assets/owl.carousel.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="@{/css/responsive.css}" rel="stylesheet">
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
</head>
最佳答案
关于java - Thymeleaf CSS 未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59847906/